diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 323ddd74..f4e6ac7b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5e564e8f..eedf7323 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d389a56b..cf1ac609 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5ae8f8e0..207ab894 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -123,7 +123,6 @@ static void Files_Assert (BOOLEAN truth) static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { - __DUP(s, s__len, CHAR); Out_Ln(); Out_String((CHAR*)"-- ", 4); Out_String(s, s__len); @@ -145,14 +144,11 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) } Out_Ln(); __HALT(99); - __DEL(s); } static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j, ld, ln; - __DUP(dir, dir__len, CHAR); - __DUP(name, name__len, CHAR); ld = Strings_Length(dir, dir__len); ln = Strings_Length(name, name__len); while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { @@ -177,14 +173,11 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS j += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(dir); - __DEL(name); } static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT16 i, n; - __DUP(finalName, finalName__len, CHAR); if (finalName[0] == '/') { __COPY(finalName, name, name__len); } else { @@ -219,7 +212,6 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; } name[__X(i, name__len)] = 0x00; - __DEL(finalName); } static void Files_Deregister (CHAR *name, ADDRESS name__len) @@ -227,7 +219,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) Platform_FileIdentity identity; Files_File osfile = NIL; INT16 error; - __DUP(name, name__len, CHAR); if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { osfile = (Files_File)Files_files; while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { @@ -246,7 +237,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) } } } - __DEL(name); } static void Files_Create (Files_File f) @@ -334,7 +324,6 @@ INT32 Files_Length (Files_File f) Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; - __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, 256); @@ -343,7 +332,6 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) f->len = 0; f->pos = 0; f->swapper = -1; - __DEL(name); return f; } @@ -1082,14 +1070,12 @@ static void Files_Finalize (SYSTEM_PTR o) void Files_SetSearchPath (CHAR *path, ADDRESS 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)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; } - __DEL(path); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 7cd089d4..04593d0f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 3565a9ea..50c0d1d9 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,7 +151,6 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) { Heap_Module m, p; - __DUP(name, name__len, CHAR); m = (Heap_Module)(ADDRESS)Heap_modules; while ((m != NIL && __STRCMP(m->name, name) != 0)) { p = m; @@ -163,14 +162,11 @@ INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) } else { p->next = m->next; } - __DEL(name); return 0; } else { if (m == NIL) { - __DEL(name); return -1; } else { - __DEL(name); return m->refcnt; } } diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 67409408..f1b5e1b0 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 28337613..260b05d6 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -100,33 +100,28 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; - __DUP(s, s__len, CHAR); i = 0; Modules_GetArg(i, (void*)arg, 256); while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; Modules_GetArg(i, (void*)arg, 256); } - __DEL(s); return i; } static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return i; } static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); while (s[__X(i, s__len)] != 0x00) { @@ -135,13 +130,11 @@ static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); if ((j > 0 && d[__X(j - 1, d__len)] != c)) { @@ -154,69 +147,54 @@ static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRES j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); if (c == 0x00) { - __DEL(s); return 0; } i = 0; while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return s[__X(i, s__len)] == c; } static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) { - __DUP(d, d__len, CHAR); if (d[0] == 0x00) { - __DEL(d); return 0; } if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { - __DEL(d); return 1; } if (d[__X(1, d__len)] == ':') { - __DEL(d); return 1; } - __DEL(d); return 0; } static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { - __DUP(s, s__len, CHAR); if (Modules_IsAbsolute(s, s__len)) { __COPY(s, d, d__len); } else { __COPY(Platform_CWD, d, d__len); Modules_AppendPart('/', s, s__len, (void*)d, d__len); } - __DEL(s); } static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) { Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); - __DEL(s); return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; } static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) { INT16 j; - __DUP(s, s__len, CHAR); - __DUP(p, p__len, CHAR); j = 0; while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { d[__X(j, d__len)] = s[__X(*i, s__len)]; @@ -227,15 +205,12 @@ static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADD while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { *i += 1; } - __DEL(s); - __DEL(p); } static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; CHAR part[1024]; - __DUP(s, s__len, CHAR); i = 0; j = 0; while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { @@ -250,7 +225,6 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) Modules_AppendPart('/', part, 1024, (void*)d, d__len); } } - __DEL(s); } typedef @@ -306,7 +280,6 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Heap_Module m = NIL; CHAR bodyname[64]; Heap_Command body; - __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { m = m->next; @@ -321,14 +294,12 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } - __DEL(name); return m; } Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { Heap_Cmd c = NIL; - __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { c = c->next; @@ -336,7 +307,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - __DEL(name); return c->cmd; } else { Modules_res = 2; @@ -346,7 +316,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); - __DEL(name); return NIL; } __RETCHK; @@ -356,7 +325,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Heap_Module m = NIL, p = NIL; INT32 refcount; - __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; @@ -374,7 +342,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) Modules_res = 1; } } - __DEL(name); } static void Modules_errch (CHAR c) @@ -386,13 +353,11 @@ static void Modules_errch (CHAR c) static void Modules_errstring (CHAR *s, ADDRESS 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_errint (INT32 l) diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ea8cdc50..1f4d96a9 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d05cb9ca..7398864a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,6 +27,7 @@ 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_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_CheckWrite (OPT_Node x); 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); @@ -101,9 +102,6 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - if ((((obj->mode == 1 && __IN(obj->typ->comp, 0x0c, 32))) && obj->typ->sysflag != 0)) { - node->readonly = 1; - } return node; } @@ -359,16 +357,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__58 { +static struct TypTest__59 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__58 *lnk; -} *TypTest__58_s; + struct TypTest__59 *lnk; +} *TypTest__59_s; -static void GTT__59 (OPT_Struct t0, OPT_Struct t1); +static void GTT__60 (OPT_Struct t0, OPT_Struct t1); -static void GTT__59 (OPT_Struct t0, OPT_Struct t1) +static void GTT__60 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -381,54 +379,54 @@ static void GTT__59 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - 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; + if (*TypTest__59_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__59_s->x, NIL); + (*TypTest__59_s->x)->readonly = (*TypTest__59_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__58_s->guard) { - if ((*TypTest__58_s->x)->class == 5) { + } else if (!*TypTest__59_s->guard) { + if ((*TypTest__59_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } else { - *TypTest__58_s->x = OPB_NewBoolConst(1); + *TypTest__59_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__58 _s; + struct TypTest__59 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__58_s; - TypTest__58_s = &_s; + _s.lnk = TypTest__59_s; + TypTest__59_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__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__60((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__59((*x)->typ, obj->typ); + GTT__60((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -437,7 +435,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__58_s = _s.lnk; + TypTest__59_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -501,13 +499,13 @@ static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__29 { + struct MOp__29 *lnk; +} *MOp__29_s; -static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__30 (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__30 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -522,9 +520,9 @@ void OPB_MOp (INT8 op, OPT_Node *x) INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__29 _s; + _s.lnk = MOp__29_s; + MOp__29_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -538,7 +536,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(98); @@ -570,7 +568,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(97); @@ -591,7 +589,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -603,7 +601,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -616,7 +614,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -629,7 +627,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) f = 8; } if (z->class < 7 || f == 8) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(127); } @@ -638,7 +636,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 25: if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(219); } @@ -655,7 +653,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__29_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -742,65 +740,65 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) } } -static struct ConstOp__13 { +static struct ConstOp__14 { OPT_Node *x; INT16 *f; OPT_Const *xval, *yval; - struct ConstOp__13 *lnk; -} *ConstOp__13_s; + struct ConstOp__14 *lnk; +} *ConstOp__14_s; -static INT16 ConstCmp__14 (void); +static INT16 ConstCmp__15 (void); -static INT16 ConstCmp__14 (void) +static INT16 ConstCmp__15 (void) { INT16 res; - switch (*ConstOp__13_s->f) { + switch (*ConstOp__14_s->f) { case 0: res = 9; break; case 1: case 3: case 4: - if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval < (*ConstOp__14_s->yval)->intval) { res = 11; - } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + } else if ((*ConstOp__14_s->xval)->intval > (*ConstOp__14_s->yval)->intval) { res = 13; } else { res = 9; } break; case 5: case 6: - if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + if ((*ConstOp__14_s->xval)->realval < (*ConstOp__14_s->yval)->realval) { res = 11; - } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + } else if ((*ConstOp__14_s->xval)->realval > (*ConstOp__14_s->yval)->realval) { res = 13; } else { res = 9; } break; case 2: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; } break; case 7: - if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + if ((*ConstOp__14_s->xval)->setval != (*ConstOp__14_s->yval)->setval) { res = 10; } else { res = 9; } break; case 8: - if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) < 0) { res = 11; - } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + } else if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) > 0) { res = 13; } else { res = 9; } break; case 9: case 11: case 12: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; @@ -808,11 +806,11 @@ static INT16 ConstCmp__14 (void) break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); - OPM_LogWNum(*ConstOp__13_s->f, 0); + OPM_LogWNum(*ConstOp__14_s->f, 0); OPM_LogWLn(); break; } - (*ConstOp__13_s->x)->typ = OPT_booltyp; + (*ConstOp__14_s->x)->typ = OPT_booltyp; return res; } @@ -822,13 +820,13 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPT_Const xval = NIL, yval = NIL; INT64 xv, yv; BOOLEAN temp; - struct ConstOp__13 _s; + struct ConstOp__14 _s; _s.x = &x; _s.f = &f; _s.xval = &xval; _s.yval = &yval; - _s.lnk = ConstOp__13_s; - ConstOp__13_s = &_s; + _s.lnk = ConstOp__14_s; + ConstOp__14_s = &_s; f = x->typ->form; g = y->typ->form; xval = x->conval; @@ -1055,37 +1053,37 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) } break; case 9: - xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 9); break; case 10: - xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 9); break; case 11: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 11); } break; case 12: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 13); } break; case 13: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 13); } break; case 14: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 11); } break; default: @@ -1094,7 +1092,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPM_LogWLn(); break; } - ConstOp__13_s = _s.lnk; + ConstOp__14_s = _s.lnk; } static void OPB_Convert (OPT_Node *x, OPT_Struct typ) @@ -1157,15 +1155,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__39 { INT16 *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__39 *lnk; +} *Op__39_s; -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__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1176,28 +1174,28 @@ static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) { 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; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 8; + if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 8; + *Op__39_s->g = 8; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 8; + *Op__39_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { + if ((*Op__39_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 == 8 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__39_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1213,11 +1211,11 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; INT64 val; - struct Op__38 _s; + struct Op__39 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__39_s; + Op__39_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1338,7 +1336,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 2: @@ -1357,7 +1355,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 3: do_ = 1; @@ -1380,7 +1378,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 4: @@ -1398,7 +1396,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1408,7 +1406,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1431,7 +1429,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 7: @@ -1440,7 +1438,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((f != 4 || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 8: @@ -1451,7 +1449,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1459,16 +1457,16 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1477,7 +1475,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); @@ -1487,7 +1485,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__39_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1672,6 +1670,19 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } +static void OPB_CheckWrite (OPT_Node x) +{ + if (x->readonly) { + OPB_err(76); + } + while (__IN(x->class, 0x74, 32)) { + x = x->left; + } + if ((x != NIL && x->obj != NIL)) { + x->obj->written = 1; + } +} + void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { INT16 f; @@ -1697,9 +1708,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if (f == 11) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); f = x->typ->BaseTyp->comp; if (__IN(f, 0x1c, 32)) { if (f == 3) { @@ -1855,8 +1864,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) OPB_err(112); } else if (f != 4) { OPB_err(111); - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 15: case 16: @@ -1865,8 +1874,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 17: @@ -1978,13 +1987,13 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) *par0 = x; } -static struct StPar1__53 { - struct StPar1__53 *lnk; -} *StPar1__53_s; +static struct StPar1__54 { + struct StPar1__54 *lnk; +} *StPar1__54_s; -static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__55 (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__55 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1999,9 +2008,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__53 _s; - _s.lnk = StPar1__53_s; - StPar1__53_s = &_s; + struct StPar1__54 _s; + _s.lnk = StPar1__54_s; + StPar1__54_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2017,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2028,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) 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); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2053,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__54(12, 19, p, x); + p = NewOp__55(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2069,13 +2078,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); t = x; x = p; p = t; - p = NewOp__54(19, 18, p, x); + p = NewOp__55(19, 18, p, x); } else { OPB_err(111); } @@ -2101,7 +2108,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) } p->obj = NIL; } else { - p = NewOp__54(12, 17, p, x); + p = NewOp__55(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2132,9 +2139,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__54(12, 27, p, x); + p = NewOp__55(12, 27, p, x); } else { - p = NewOp__54(12, 28, p, x); + p = NewOp__55(12, 28, p, x); } p->typ = p->left->typ; } @@ -2151,7 +2158,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) x = p; p = t; } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2161,7 +2168,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__54(12, 26, p, x); + p = NewOp__55(12, 26, p, x); } else { OPB_err(111); } @@ -2191,7 +2198,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__54(19, 30, p, x); + p = NewOp__55(19, 30, p, x); } else { OPB_err(111); } @@ -2237,7 +2244,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) break; } *par0 = p; - StPar1__53_s = _s.lnk; + StPar1__54_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) @@ -2356,7 +2363,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; - if (((fvarpar || sysflag != 0) && ftyp == OPT_bytetyp)) { + if (ftyp == OPT_bytetyp) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { if (__IN(18, OPM_Options, 32)) { OPB_err(-301); @@ -2426,9 +2433,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } else { OPB_CheckLeaf(ap, 0); } - if (ap->readonly) { - OPB_err(76); - } + OPB_CheckWrite(ap); if (fp->typ->comp == 3) { OPB_DynArrParCheck(fp->typ, ap->typ, 1); } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { @@ -2540,9 +2545,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_err(56); } OPB_CheckAssign((*x)->typ, y); - if ((*x)->readonly) { - OPB_err(76); - } + OPB_CheckWrite(*x); if ((*x)->typ->comp == 4) { if ((*x)->class == 5) { z = (*x)->left; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8277e38f..a81af7dd 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0fdd8d5a..1fe12e58 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -141,7 +141,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; - __DUP(s, s__len, CHAR); ch = s[0]; i = 0; while (ch != 0x00) { @@ -153,7 +152,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) i += 1; ch = s[__X(i, s__len)]; } - __DEL(s); } static INT16 OPC_Length (CHAR *s, ADDRESS s__len) @@ -727,12 +725,10 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; - __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - __DEL(y); return y[__X(i, y__len)] == 0x00; } @@ -1466,7 +1462,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((var->typ->comp == 2 && var->mode == 1)) { + if ((((var->written && var->typ->comp == 2)) && var->mode == 1)) { OPC_BegStat(); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); @@ -1482,7 +1478,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && __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); @@ -1632,7 +1628,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } var = proc->link; while (var != NIL) { - if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && var->typ->comp == 3)) && var->mode == 1)) && var->typ->sysflag == 0)) { if (indent) { OPC_BegStat(); } else { @@ -1752,7 +1748,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; - __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { @@ -1773,7 +1768,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) i += 1; } OPM_Write('"'); - __DEL(s); } void OPC_Case (INT64 caseVal, INT16 form) diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 9753be69..dceec267 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ab64f723..fb2bb9f9 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -112,9 +112,7 @@ void OPM_LogW (CHAR ch) void OPM_LogWStr (CHAR *s, ADDRESS s__len) { - __DUP(s, s__len, CHAR); Out_String(s, s__len); - __DEL(s); } void OPM_LogWNum (INT64 i, INT64 len) @@ -129,16 +127,13 @@ void OPM_LogWLn (void) void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { - __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { VT100_SetAttr(vt100code, vt100code__len); } - __DEL(vt100code); } void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) { - __DUP(modname, modname__len, CHAR); OPM_LogWStr((CHAR*)"Compiling ", 11); OPM_LogWStr(modname, modname__len); if (__IN(18, OPM_Options, 32)) { @@ -154,7 +149,6 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); } OPM_LogW('.'); - __DEL(modname); } INT64 OPM_SignedMaximum (INT32 bytecount) @@ -183,7 +177,6 @@ INT16 OPM_Integer (INT64 n) static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -263,7 +256,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) } i += 1; } - __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -338,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +402,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); @@ -492,7 +488,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES { INT16 i, j; CHAR ch; - __DUP(ext, ext__len, CHAR); i = 0; for (;;) { ch = name[__X(i, name__len)]; @@ -509,7 +504,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES i += 1; j += 1; } while (!(ch == 0x00)); - __DEL(ext); } static void OPM_LogErrMsg (INT16 n) @@ -1050,28 +1044,23 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { CHAR testpath[4096]; Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } - __DEL(s); return 1; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index da46f609..98d27008 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ff4688fb..6f42624f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 73c8598f..73c2a584 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 664a235c..f69e0939 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index cb9bc36e..de90089e 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9d02b8b0..aed032ec 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -77,7 +77,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 40dca306..fc2ce0c6 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -55,7 +55,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 55f230a1..89d4c32d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ecd47da2..73d437e0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 2db4d30c..b0771ca9 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 49eddd6f..82fbe7a1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3738fb78..25674504 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -209,22 +209,18 @@ typedef BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { EnvPtr__83 p = NIL; - __DUP(var, var__len, CHAR); p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - __DEL(var); return p != NIL; } void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { val[0] = 0x00; } - __DEL(var); } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -280,8 +276,6 @@ void Platform_Delay (INT32 ms) INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { - __DUP(cmd, cmd__len, CHAR); - __DEL(cmd); return Platform_system(cmd, cmd__len); } @@ -358,16 +352,13 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - __DEL(n); return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - __DEL(n); return 0; } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 98e2c42c..b12fb825 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2636c568..7e623d5d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 222cb788..c839d865 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 22943103..a2b57ee8 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,7 +42,6 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; - __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; @@ -53,7 +52,6 @@ void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__ if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } - __DEL(extra); } void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) @@ -112,16 +110,13 @@ void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { - __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); Strings_Insert(source, source__len, pos, (void*)dest, dest__len); - __DEL(source); } void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; - __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { @@ -129,7 +124,6 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA } if (pos >= len) { dest[0] = 0x00; - __DEL(source); return; } i = 0; @@ -140,19 +134,14 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA i += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(source); } INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; - __DUP(pattern, pattern__len, CHAR); - __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - __DEL(pattern); - __DEL(s); return 0; } i = pos; @@ -163,15 +152,11 @@ INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, j += 1; } if (j == n2) { - __DEL(pattern); - __DEL(s); return i; } } i += 1; } - __DEL(pattern); - __DEL(s); return -1; } @@ -241,7 +226,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) INT16 p, e; REAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -295,7 +279,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) y = -y; } *r = y; - __DEL(s); } void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) @@ -303,7 +286,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) INT16 p, e; LONGREAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -357,7 +339,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) y = -y; } *r = y; - __DEL(s); } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 7ff642d1..21bf151b 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 2a0b8f9e..dbdcee14 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1031,13 +1031,11 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { Texts_Write(&*W, W__typ, s[__X(i, s__len)]); i += 1; } - __DEL(s); } void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) @@ -1548,7 +1546,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) Texts_Piece p = NIL; CHAR tag, version; INT32 hlen; - __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { f = Files_New((CHAR*)"", 1); @@ -1593,7 +1590,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) T->cache = T->head; T->corg = 0; } - __DEL(name); } static struct Store__39 { @@ -1762,7 +1758,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) Files_Rider r; INT16 i, res; CHAR bak[64]; - __DUP(name, name__len, CHAR); f = Files_New(name, name__len); Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); @@ -1780,7 +1775,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) bak[__X(i + 4, 64)] = 0x00; Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); - __DEL(name); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0aa8f1c9..776c394c 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 54cdf683..81684069 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,44 +87,37 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; - __DUP(letter, letter__len, CHAR); __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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS 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); @@ -133,7 +126,6 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); Out_String(cmd, 12); - __DEL(letter); } void VT100_CUU (INT16 n) @@ -239,11 +231,9 @@ void VT100_DECTCEMh (void) void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; - __DUP(attr, attr__len, CHAR); __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); - __DEL(attr); } diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 579843b3..04fe2795 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 02e4cc5c..e3988ab0 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -31,8 +31,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES { INT16 r, status, exitcode; extTools_CommandString fullcmd; - __DUP(title, title__len, CHAR); - __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); Out_String(cmd, cmd__len); @@ -66,8 +64,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES Modules_Halt(exitcode); } } - __DEL(title); - __DEL(cmd); } static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) @@ -84,19 +80,16 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; - __DUP(moduleName, moduleName__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); - __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { extTools_CommandString cmd; - __DUP(additionalopts, additionalopts__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); @@ -116,7 +109,6 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); - __DEL(additionalopts); } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index eec380ca..2a14f64d 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 323ddd74..f4e6ac7b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5e564e8f..eedf7323 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d389a56b..cf1ac609 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5ae8f8e0..207ab894 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -123,7 +123,6 @@ static void Files_Assert (BOOLEAN truth) static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { - __DUP(s, s__len, CHAR); Out_Ln(); Out_String((CHAR*)"-- ", 4); Out_String(s, s__len); @@ -145,14 +144,11 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) } Out_Ln(); __HALT(99); - __DEL(s); } static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j, ld, ln; - __DUP(dir, dir__len, CHAR); - __DUP(name, name__len, CHAR); ld = Strings_Length(dir, dir__len); ln = Strings_Length(name, name__len); while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { @@ -177,14 +173,11 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS j += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(dir); - __DEL(name); } static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT16 i, n; - __DUP(finalName, finalName__len, CHAR); if (finalName[0] == '/') { __COPY(finalName, name, name__len); } else { @@ -219,7 +212,6 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; } name[__X(i, name__len)] = 0x00; - __DEL(finalName); } static void Files_Deregister (CHAR *name, ADDRESS name__len) @@ -227,7 +219,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) Platform_FileIdentity identity; Files_File osfile = NIL; INT16 error; - __DUP(name, name__len, CHAR); if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { osfile = (Files_File)Files_files; while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { @@ -246,7 +237,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) } } } - __DEL(name); } static void Files_Create (Files_File f) @@ -334,7 +324,6 @@ INT32 Files_Length (Files_File f) Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; - __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, 256); @@ -343,7 +332,6 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) f->len = 0; f->pos = 0; f->swapper = -1; - __DEL(name); return f; } @@ -1082,14 +1070,12 @@ static void Files_Finalize (SYSTEM_PTR o) void Files_SetSearchPath (CHAR *path, ADDRESS 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)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; } - __DEL(path); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 7cd089d4..04593d0f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 3565a9ea..50c0d1d9 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,7 +151,6 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) { Heap_Module m, p; - __DUP(name, name__len, CHAR); m = (Heap_Module)(ADDRESS)Heap_modules; while ((m != NIL && __STRCMP(m->name, name) != 0)) { p = m; @@ -163,14 +162,11 @@ INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) } else { p->next = m->next; } - __DEL(name); return 0; } else { if (m == NIL) { - __DEL(name); return -1; } else { - __DEL(name); return m->refcnt; } } diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 67409408..f1b5e1b0 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 28337613..260b05d6 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -100,33 +100,28 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; - __DUP(s, s__len, CHAR); i = 0; Modules_GetArg(i, (void*)arg, 256); while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; Modules_GetArg(i, (void*)arg, 256); } - __DEL(s); return i; } static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return i; } static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); while (s[__X(i, s__len)] != 0x00) { @@ -135,13 +130,11 @@ static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); if ((j > 0 && d[__X(j - 1, d__len)] != c)) { @@ -154,69 +147,54 @@ static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRES j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); if (c == 0x00) { - __DEL(s); return 0; } i = 0; while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return s[__X(i, s__len)] == c; } static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) { - __DUP(d, d__len, CHAR); if (d[0] == 0x00) { - __DEL(d); return 0; } if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { - __DEL(d); return 1; } if (d[__X(1, d__len)] == ':') { - __DEL(d); return 1; } - __DEL(d); return 0; } static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { - __DUP(s, s__len, CHAR); if (Modules_IsAbsolute(s, s__len)) { __COPY(s, d, d__len); } else { __COPY(Platform_CWD, d, d__len); Modules_AppendPart('/', s, s__len, (void*)d, d__len); } - __DEL(s); } static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) { Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); - __DEL(s); return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; } static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) { INT16 j; - __DUP(s, s__len, CHAR); - __DUP(p, p__len, CHAR); j = 0; while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { d[__X(j, d__len)] = s[__X(*i, s__len)]; @@ -227,15 +205,12 @@ static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADD while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { *i += 1; } - __DEL(s); - __DEL(p); } static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; CHAR part[1024]; - __DUP(s, s__len, CHAR); i = 0; j = 0; while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { @@ -250,7 +225,6 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) Modules_AppendPart('/', part, 1024, (void*)d, d__len); } } - __DEL(s); } typedef @@ -306,7 +280,6 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Heap_Module m = NIL; CHAR bodyname[64]; Heap_Command body; - __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { m = m->next; @@ -321,14 +294,12 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } - __DEL(name); return m; } Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { Heap_Cmd c = NIL; - __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { c = c->next; @@ -336,7 +307,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - __DEL(name); return c->cmd; } else { Modules_res = 2; @@ -346,7 +316,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); - __DEL(name); return NIL; } __RETCHK; @@ -356,7 +325,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Heap_Module m = NIL, p = NIL; INT32 refcount; - __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; @@ -374,7 +342,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) Modules_res = 1; } } - __DEL(name); } static void Modules_errch (CHAR c) @@ -386,13 +353,11 @@ static void Modules_errch (CHAR c) static void Modules_errstring (CHAR *s, ADDRESS 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_errint (INT32 l) diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ea8cdc50..1f4d96a9 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d05cb9ca..7398864a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,6 +27,7 @@ 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_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_CheckWrite (OPT_Node x); 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); @@ -101,9 +102,6 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - if ((((obj->mode == 1 && __IN(obj->typ->comp, 0x0c, 32))) && obj->typ->sysflag != 0)) { - node->readonly = 1; - } return node; } @@ -359,16 +357,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__58 { +static struct TypTest__59 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__58 *lnk; -} *TypTest__58_s; + struct TypTest__59 *lnk; +} *TypTest__59_s; -static void GTT__59 (OPT_Struct t0, OPT_Struct t1); +static void GTT__60 (OPT_Struct t0, OPT_Struct t1); -static void GTT__59 (OPT_Struct t0, OPT_Struct t1) +static void GTT__60 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -381,54 +379,54 @@ static void GTT__59 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - 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; + if (*TypTest__59_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__59_s->x, NIL); + (*TypTest__59_s->x)->readonly = (*TypTest__59_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__58_s->guard) { - if ((*TypTest__58_s->x)->class == 5) { + } else if (!*TypTest__59_s->guard) { + if ((*TypTest__59_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } else { - *TypTest__58_s->x = OPB_NewBoolConst(1); + *TypTest__59_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__58 _s; + struct TypTest__59 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__58_s; - TypTest__58_s = &_s; + _s.lnk = TypTest__59_s; + TypTest__59_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__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__60((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__59((*x)->typ, obj->typ); + GTT__60((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -437,7 +435,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__58_s = _s.lnk; + TypTest__59_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -501,13 +499,13 @@ static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__29 { + struct MOp__29 *lnk; +} *MOp__29_s; -static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__30 (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__30 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -522,9 +520,9 @@ void OPB_MOp (INT8 op, OPT_Node *x) INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__29 _s; + _s.lnk = MOp__29_s; + MOp__29_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -538,7 +536,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(98); @@ -570,7 +568,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(97); @@ -591,7 +589,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -603,7 +601,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -616,7 +614,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -629,7 +627,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) f = 8; } if (z->class < 7 || f == 8) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(127); } @@ -638,7 +636,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 25: if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(219); } @@ -655,7 +653,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__29_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -742,65 +740,65 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) } } -static struct ConstOp__13 { +static struct ConstOp__14 { OPT_Node *x; INT16 *f; OPT_Const *xval, *yval; - struct ConstOp__13 *lnk; -} *ConstOp__13_s; + struct ConstOp__14 *lnk; +} *ConstOp__14_s; -static INT16 ConstCmp__14 (void); +static INT16 ConstCmp__15 (void); -static INT16 ConstCmp__14 (void) +static INT16 ConstCmp__15 (void) { INT16 res; - switch (*ConstOp__13_s->f) { + switch (*ConstOp__14_s->f) { case 0: res = 9; break; case 1: case 3: case 4: - if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval < (*ConstOp__14_s->yval)->intval) { res = 11; - } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + } else if ((*ConstOp__14_s->xval)->intval > (*ConstOp__14_s->yval)->intval) { res = 13; } else { res = 9; } break; case 5: case 6: - if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + if ((*ConstOp__14_s->xval)->realval < (*ConstOp__14_s->yval)->realval) { res = 11; - } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + } else if ((*ConstOp__14_s->xval)->realval > (*ConstOp__14_s->yval)->realval) { res = 13; } else { res = 9; } break; case 2: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; } break; case 7: - if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + if ((*ConstOp__14_s->xval)->setval != (*ConstOp__14_s->yval)->setval) { res = 10; } else { res = 9; } break; case 8: - if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) < 0) { res = 11; - } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + } else if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) > 0) { res = 13; } else { res = 9; } break; case 9: case 11: case 12: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; @@ -808,11 +806,11 @@ static INT16 ConstCmp__14 (void) break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); - OPM_LogWNum(*ConstOp__13_s->f, 0); + OPM_LogWNum(*ConstOp__14_s->f, 0); OPM_LogWLn(); break; } - (*ConstOp__13_s->x)->typ = OPT_booltyp; + (*ConstOp__14_s->x)->typ = OPT_booltyp; return res; } @@ -822,13 +820,13 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPT_Const xval = NIL, yval = NIL; INT64 xv, yv; BOOLEAN temp; - struct ConstOp__13 _s; + struct ConstOp__14 _s; _s.x = &x; _s.f = &f; _s.xval = &xval; _s.yval = &yval; - _s.lnk = ConstOp__13_s; - ConstOp__13_s = &_s; + _s.lnk = ConstOp__14_s; + ConstOp__14_s = &_s; f = x->typ->form; g = y->typ->form; xval = x->conval; @@ -1055,37 +1053,37 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) } break; case 9: - xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 9); break; case 10: - xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 9); break; case 11: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 11); } break; case 12: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 13); } break; case 13: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 13); } break; case 14: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 11); } break; default: @@ -1094,7 +1092,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPM_LogWLn(); break; } - ConstOp__13_s = _s.lnk; + ConstOp__14_s = _s.lnk; } static void OPB_Convert (OPT_Node *x, OPT_Struct typ) @@ -1157,15 +1155,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__39 { INT16 *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__39 *lnk; +} *Op__39_s; -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__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1176,28 +1174,28 @@ static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) { 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; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 8; + if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 8; + *Op__39_s->g = 8; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 8; + *Op__39_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { + if ((*Op__39_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 == 8 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__39_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1213,11 +1211,11 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; INT64 val; - struct Op__38 _s; + struct Op__39 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__39_s; + Op__39_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1338,7 +1336,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 2: @@ -1357,7 +1355,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 3: do_ = 1; @@ -1380,7 +1378,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 4: @@ -1398,7 +1396,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1408,7 +1406,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1431,7 +1429,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 7: @@ -1440,7 +1438,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((f != 4 || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 8: @@ -1451,7 +1449,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1459,16 +1457,16 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1477,7 +1475,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); @@ -1487,7 +1485,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__39_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1672,6 +1670,19 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } +static void OPB_CheckWrite (OPT_Node x) +{ + if (x->readonly) { + OPB_err(76); + } + while (__IN(x->class, 0x74, 32)) { + x = x->left; + } + if ((x != NIL && x->obj != NIL)) { + x->obj->written = 1; + } +} + void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { INT16 f; @@ -1697,9 +1708,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if (f == 11) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); f = x->typ->BaseTyp->comp; if (__IN(f, 0x1c, 32)) { if (f == 3) { @@ -1855,8 +1864,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) OPB_err(112); } else if (f != 4) { OPB_err(111); - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 15: case 16: @@ -1865,8 +1874,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 17: @@ -1978,13 +1987,13 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) *par0 = x; } -static struct StPar1__53 { - struct StPar1__53 *lnk; -} *StPar1__53_s; +static struct StPar1__54 { + struct StPar1__54 *lnk; +} *StPar1__54_s; -static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__55 (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__55 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1999,9 +2008,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__53 _s; - _s.lnk = StPar1__53_s; - StPar1__53_s = &_s; + struct StPar1__54 _s; + _s.lnk = StPar1__54_s; + StPar1__54_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2017,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2028,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) 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); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2053,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__54(12, 19, p, x); + p = NewOp__55(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2069,13 +2078,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); t = x; x = p; p = t; - p = NewOp__54(19, 18, p, x); + p = NewOp__55(19, 18, p, x); } else { OPB_err(111); } @@ -2101,7 +2108,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) } p->obj = NIL; } else { - p = NewOp__54(12, 17, p, x); + p = NewOp__55(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2132,9 +2139,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__54(12, 27, p, x); + p = NewOp__55(12, 27, p, x); } else { - p = NewOp__54(12, 28, p, x); + p = NewOp__55(12, 28, p, x); } p->typ = p->left->typ; } @@ -2151,7 +2158,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) x = p; p = t; } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2161,7 +2168,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__54(12, 26, p, x); + p = NewOp__55(12, 26, p, x); } else { OPB_err(111); } @@ -2191,7 +2198,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__54(19, 30, p, x); + p = NewOp__55(19, 30, p, x); } else { OPB_err(111); } @@ -2237,7 +2244,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) break; } *par0 = p; - StPar1__53_s = _s.lnk; + StPar1__54_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) @@ -2356,7 +2363,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; - if (((fvarpar || sysflag != 0) && ftyp == OPT_bytetyp)) { + if (ftyp == OPT_bytetyp) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { if (__IN(18, OPM_Options, 32)) { OPB_err(-301); @@ -2426,9 +2433,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } else { OPB_CheckLeaf(ap, 0); } - if (ap->readonly) { - OPB_err(76); - } + OPB_CheckWrite(ap); if (fp->typ->comp == 3) { OPB_DynArrParCheck(fp->typ, ap->typ, 1); } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { @@ -2540,9 +2545,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_err(56); } OPB_CheckAssign((*x)->typ, y); - if ((*x)->readonly) { - OPB_err(76); - } + OPB_CheckWrite(*x); if ((*x)->typ->comp == 4) { if ((*x)->class == 5) { z = (*x)->left; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8277e38f..a81af7dd 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0fdd8d5a..1fe12e58 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -141,7 +141,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; - __DUP(s, s__len, CHAR); ch = s[0]; i = 0; while (ch != 0x00) { @@ -153,7 +152,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) i += 1; ch = s[__X(i, s__len)]; } - __DEL(s); } static INT16 OPC_Length (CHAR *s, ADDRESS s__len) @@ -727,12 +725,10 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; - __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - __DEL(y); return y[__X(i, y__len)] == 0x00; } @@ -1466,7 +1462,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((var->typ->comp == 2 && var->mode == 1)) { + if ((((var->written && var->typ->comp == 2)) && var->mode == 1)) { OPC_BegStat(); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); @@ -1482,7 +1478,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && __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); @@ -1632,7 +1628,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } var = proc->link; while (var != NIL) { - if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && var->typ->comp == 3)) && var->mode == 1)) && var->typ->sysflag == 0)) { if (indent) { OPC_BegStat(); } else { @@ -1752,7 +1748,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; - __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { @@ -1773,7 +1768,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) i += 1; } OPM_Write('"'); - __DEL(s); } void OPC_Case (INT64 caseVal, INT16 form) diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 9753be69..dceec267 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ab64f723..fb2bb9f9 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -112,9 +112,7 @@ void OPM_LogW (CHAR ch) void OPM_LogWStr (CHAR *s, ADDRESS s__len) { - __DUP(s, s__len, CHAR); Out_String(s, s__len); - __DEL(s); } void OPM_LogWNum (INT64 i, INT64 len) @@ -129,16 +127,13 @@ void OPM_LogWLn (void) void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { - __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { VT100_SetAttr(vt100code, vt100code__len); } - __DEL(vt100code); } void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) { - __DUP(modname, modname__len, CHAR); OPM_LogWStr((CHAR*)"Compiling ", 11); OPM_LogWStr(modname, modname__len); if (__IN(18, OPM_Options, 32)) { @@ -154,7 +149,6 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); } OPM_LogW('.'); - __DEL(modname); } INT64 OPM_SignedMaximum (INT32 bytecount) @@ -183,7 +177,6 @@ INT16 OPM_Integer (INT64 n) static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -263,7 +256,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) } i += 1; } - __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -338,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +402,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); @@ -492,7 +488,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES { INT16 i, j; CHAR ch; - __DUP(ext, ext__len, CHAR); i = 0; for (;;) { ch = name[__X(i, name__len)]; @@ -509,7 +504,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES i += 1; j += 1; } while (!(ch == 0x00)); - __DEL(ext); } static void OPM_LogErrMsg (INT16 n) @@ -1050,28 +1044,23 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { CHAR testpath[4096]; Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } - __DEL(s); return 1; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index da46f609..98d27008 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ff4688fb..6f42624f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 73c8598f..73c2a584 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 664a235c..f69e0939 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index cb9bc36e..de90089e 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 5a01a9e2..2dff5173 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -77,7 +77,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 40dca306..fc2ce0c6 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -55,7 +55,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 55f230a1..89d4c32d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ecd47da2..73d437e0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 2db4d30c..b0771ca9 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 49eddd6f..82fbe7a1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3738fb78..25674504 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -209,22 +209,18 @@ typedef BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { EnvPtr__83 p = NIL; - __DUP(var, var__len, CHAR); p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - __DEL(var); return p != NIL; } void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { val[0] = 0x00; } - __DEL(var); } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -280,8 +276,6 @@ void Platform_Delay (INT32 ms) INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { - __DUP(cmd, cmd__len, CHAR); - __DEL(cmd); return Platform_system(cmd, cmd__len); } @@ -358,16 +352,13 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - __DEL(n); return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - __DEL(n); return 0; } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 98e2c42c..b12fb825 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2636c568..7e623d5d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 222cb788..c839d865 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 22943103..a2b57ee8 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,7 +42,6 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; - __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; @@ -53,7 +52,6 @@ void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__ if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } - __DEL(extra); } void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) @@ -112,16 +110,13 @@ void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { - __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); Strings_Insert(source, source__len, pos, (void*)dest, dest__len); - __DEL(source); } void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; - __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { @@ -129,7 +124,6 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA } if (pos >= len) { dest[0] = 0x00; - __DEL(source); return; } i = 0; @@ -140,19 +134,14 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA i += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(source); } INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; - __DUP(pattern, pattern__len, CHAR); - __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - __DEL(pattern); - __DEL(s); return 0; } i = pos; @@ -163,15 +152,11 @@ INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, j += 1; } if (j == n2) { - __DEL(pattern); - __DEL(s); return i; } } i += 1; } - __DEL(pattern); - __DEL(s); return -1; } @@ -241,7 +226,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) INT16 p, e; REAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -295,7 +279,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) y = -y; } *r = y; - __DEL(s); } void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) @@ -303,7 +286,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) INT16 p, e; LONGREAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -357,7 +339,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) y = -y; } *r = y; - __DEL(s); } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 7ff642d1..21bf151b 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index d335e885..9c01a7b5 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1031,13 +1031,11 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { Texts_Write(&*W, W__typ, s[__X(i, s__len)]); i += 1; } - __DEL(s); } void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) @@ -1548,7 +1546,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) Texts_Piece p = NIL; CHAR tag, version; INT32 hlen; - __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { f = Files_New((CHAR*)"", 1); @@ -1593,7 +1590,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) T->cache = T->head; T->corg = 0; } - __DEL(name); } static struct Store__39 { @@ -1762,7 +1758,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) Files_Rider r; INT16 i, res; CHAR bak[64]; - __DUP(name, name__len, CHAR); f = Files_New(name, name__len); Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); @@ -1780,7 +1775,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) bak[__X(i + 4, 64)] = 0x00; Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); - __DEL(name); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 26975686..e7ebbd80 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 54cdf683..81684069 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,44 +87,37 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; - __DUP(letter, letter__len, CHAR); __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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS 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); @@ -133,7 +126,6 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); Out_String(cmd, 12); - __DEL(letter); } void VT100_CUU (INT16 n) @@ -239,11 +231,9 @@ void VT100_DECTCEMh (void) void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; - __DUP(attr, attr__len, CHAR); __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); - __DEL(attr); } diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 579843b3..04fe2795 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 02e4cc5c..e3988ab0 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -31,8 +31,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES { INT16 r, status, exitcode; extTools_CommandString fullcmd; - __DUP(title, title__len, CHAR); - __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); Out_String(cmd, cmd__len); @@ -66,8 +64,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES Modules_Halt(exitcode); } } - __DEL(title); - __DEL(cmd); } static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) @@ -84,19 +80,16 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; - __DUP(moduleName, moduleName__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); - __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { extTools_CommandString cmd; - __DUP(additionalopts, additionalopts__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); @@ -116,7 +109,6 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); - __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index eec380ca..2a14f64d 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 323ddd74..f4e6ac7b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5e564e8f..eedf7323 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d389a56b..cf1ac609 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 39a442b5..57c74f14 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -123,7 +123,6 @@ static void Files_Assert (BOOLEAN truth) static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { - __DUP(s, s__len, CHAR); Out_Ln(); Out_String((CHAR*)"-- ", 4); Out_String(s, s__len); @@ -145,14 +144,11 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) } Out_Ln(); __HALT(99); - __DEL(s); } static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j, ld, ln; - __DUP(dir, dir__len, CHAR); - __DUP(name, name__len, CHAR); ld = Strings_Length(dir, dir__len); ln = Strings_Length(name, name__len); while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { @@ -177,14 +173,11 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS j += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(dir); - __DEL(name); } static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT16 i, n; - __DUP(finalName, finalName__len, CHAR); if (finalName[0] == '/') { __COPY(finalName, name, name__len); } else { @@ -219,7 +212,6 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; } name[__X(i, name__len)] = 0x00; - __DEL(finalName); } static void Files_Deregister (CHAR *name, ADDRESS name__len) @@ -227,7 +219,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) Platform_FileIdentity identity; Files_File osfile = NIL; INT16 error; - __DUP(name, name__len, CHAR); if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { osfile = (Files_File)Files_files; while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { @@ -246,7 +237,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) } } } - __DEL(name); } static void Files_Create (Files_File f) @@ -334,7 +324,6 @@ INT32 Files_Length (Files_File f) Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; - __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, 256); @@ -343,7 +332,6 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) f->len = 0; f->pos = 0; f->swapper = -1; - __DEL(name); return f; } @@ -1082,14 +1070,12 @@ static void Files_Finalize (SYSTEM_PTR o) void Files_SetSearchPath (CHAR *path, ADDRESS 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)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; } - __DEL(path); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4ec33fd7..bd7c98dd 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 2849cbd2..bbfbc892 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,7 +151,6 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) { Heap_Module m, p; - __DUP(name, name__len, CHAR); m = (Heap_Module)(ADDRESS)Heap_modules; while ((m != NIL && __STRCMP(m->name, name) != 0)) { p = m; @@ -163,14 +162,11 @@ INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) } else { p->next = m->next; } - __DEL(name); return 0; } else { if (m == NIL) { - __DEL(name); return -1; } else { - __DEL(name); return m->refcnt; } } diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index bcf0a8c8..75ea9537 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0ad2f59a..a3a770ea 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -100,33 +100,28 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; - __DUP(s, s__len, CHAR); i = 0; Modules_GetArg(i, (void*)arg, 256); while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; Modules_GetArg(i, (void*)arg, 256); } - __DEL(s); return i; } static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return i; } static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); while (s[__X(i, s__len)] != 0x00) { @@ -135,13 +130,11 @@ static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); if ((j > 0 && d[__X(j - 1, d__len)] != c)) { @@ -154,69 +147,54 @@ static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRES j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); if (c == 0x00) { - __DEL(s); return 0; } i = 0; while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return s[__X(i, s__len)] == c; } static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) { - __DUP(d, d__len, CHAR); if (d[0] == 0x00) { - __DEL(d); return 0; } if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { - __DEL(d); return 1; } if (d[__X(1, d__len)] == ':') { - __DEL(d); return 1; } - __DEL(d); return 0; } static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { - __DUP(s, s__len, CHAR); if (Modules_IsAbsolute(s, s__len)) { __COPY(s, d, d__len); } else { __COPY(Platform_CWD, d, d__len); Modules_AppendPart('/', s, s__len, (void*)d, d__len); } - __DEL(s); } static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) { Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); - __DEL(s); return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; } static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) { INT16 j; - __DUP(s, s__len, CHAR); - __DUP(p, p__len, CHAR); j = 0; while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { d[__X(j, d__len)] = s[__X(*i, s__len)]; @@ -227,15 +205,12 @@ static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADD while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { *i += 1; } - __DEL(s); - __DEL(p); } static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; CHAR part[1024]; - __DUP(s, s__len, CHAR); i = 0; j = 0; while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { @@ -250,7 +225,6 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) Modules_AppendPart('/', part, 1024, (void*)d, d__len); } } - __DEL(s); } typedef @@ -306,7 +280,6 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Heap_Module m = NIL; CHAR bodyname[64]; Heap_Command body; - __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { m = m->next; @@ -321,14 +294,12 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } - __DEL(name); return m; } Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { Heap_Cmd c = NIL; - __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { c = c->next; @@ -336,7 +307,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - __DEL(name); return c->cmd; } else { Modules_res = 2; @@ -346,7 +316,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); - __DEL(name); return NIL; } __RETCHK; @@ -356,7 +325,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Heap_Module m = NIL, p = NIL; INT32 refcount; - __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; @@ -374,7 +342,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) Modules_res = 1; } } - __DEL(name); } static void Modules_errch (CHAR c) @@ -386,13 +353,11 @@ static void Modules_errch (CHAR c) static void Modules_errstring (CHAR *s, ADDRESS 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_errint (INT32 l) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d95e7a49..8a733e88 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d05cb9ca..7398864a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,6 +27,7 @@ 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_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_CheckWrite (OPT_Node x); 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); @@ -101,9 +102,6 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - if ((((obj->mode == 1 && __IN(obj->typ->comp, 0x0c, 32))) && obj->typ->sysflag != 0)) { - node->readonly = 1; - } return node; } @@ -359,16 +357,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__58 { +static struct TypTest__59 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__58 *lnk; -} *TypTest__58_s; + struct TypTest__59 *lnk; +} *TypTest__59_s; -static void GTT__59 (OPT_Struct t0, OPT_Struct t1); +static void GTT__60 (OPT_Struct t0, OPT_Struct t1); -static void GTT__59 (OPT_Struct t0, OPT_Struct t1) +static void GTT__60 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -381,54 +379,54 @@ static void GTT__59 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - 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; + if (*TypTest__59_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__59_s->x, NIL); + (*TypTest__59_s->x)->readonly = (*TypTest__59_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__58_s->guard) { - if ((*TypTest__58_s->x)->class == 5) { + } else if (!*TypTest__59_s->guard) { + if ((*TypTest__59_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } else { - *TypTest__58_s->x = OPB_NewBoolConst(1); + *TypTest__59_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__58 _s; + struct TypTest__59 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__58_s; - TypTest__58_s = &_s; + _s.lnk = TypTest__59_s; + TypTest__59_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__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__60((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__59((*x)->typ, obj->typ); + GTT__60((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -437,7 +435,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__58_s = _s.lnk; + TypTest__59_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -501,13 +499,13 @@ static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__29 { + struct MOp__29 *lnk; +} *MOp__29_s; -static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__30 (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__30 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -522,9 +520,9 @@ void OPB_MOp (INT8 op, OPT_Node *x) INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__29 _s; + _s.lnk = MOp__29_s; + MOp__29_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -538,7 +536,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(98); @@ -570,7 +568,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(97); @@ -591,7 +589,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -603,7 +601,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -616,7 +614,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -629,7 +627,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) f = 8; } if (z->class < 7 || f == 8) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(127); } @@ -638,7 +636,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 25: if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(219); } @@ -655,7 +653,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__29_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -742,65 +740,65 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) } } -static struct ConstOp__13 { +static struct ConstOp__14 { OPT_Node *x; INT16 *f; OPT_Const *xval, *yval; - struct ConstOp__13 *lnk; -} *ConstOp__13_s; + struct ConstOp__14 *lnk; +} *ConstOp__14_s; -static INT16 ConstCmp__14 (void); +static INT16 ConstCmp__15 (void); -static INT16 ConstCmp__14 (void) +static INT16 ConstCmp__15 (void) { INT16 res; - switch (*ConstOp__13_s->f) { + switch (*ConstOp__14_s->f) { case 0: res = 9; break; case 1: case 3: case 4: - if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval < (*ConstOp__14_s->yval)->intval) { res = 11; - } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + } else if ((*ConstOp__14_s->xval)->intval > (*ConstOp__14_s->yval)->intval) { res = 13; } else { res = 9; } break; case 5: case 6: - if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + if ((*ConstOp__14_s->xval)->realval < (*ConstOp__14_s->yval)->realval) { res = 11; - } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + } else if ((*ConstOp__14_s->xval)->realval > (*ConstOp__14_s->yval)->realval) { res = 13; } else { res = 9; } break; case 2: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; } break; case 7: - if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + if ((*ConstOp__14_s->xval)->setval != (*ConstOp__14_s->yval)->setval) { res = 10; } else { res = 9; } break; case 8: - if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) < 0) { res = 11; - } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + } else if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) > 0) { res = 13; } else { res = 9; } break; case 9: case 11: case 12: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; @@ -808,11 +806,11 @@ static INT16 ConstCmp__14 (void) break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); - OPM_LogWNum(*ConstOp__13_s->f, 0); + OPM_LogWNum(*ConstOp__14_s->f, 0); OPM_LogWLn(); break; } - (*ConstOp__13_s->x)->typ = OPT_booltyp; + (*ConstOp__14_s->x)->typ = OPT_booltyp; return res; } @@ -822,13 +820,13 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPT_Const xval = NIL, yval = NIL; INT64 xv, yv; BOOLEAN temp; - struct ConstOp__13 _s; + struct ConstOp__14 _s; _s.x = &x; _s.f = &f; _s.xval = &xval; _s.yval = &yval; - _s.lnk = ConstOp__13_s; - ConstOp__13_s = &_s; + _s.lnk = ConstOp__14_s; + ConstOp__14_s = &_s; f = x->typ->form; g = y->typ->form; xval = x->conval; @@ -1055,37 +1053,37 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) } break; case 9: - xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 9); break; case 10: - xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 9); break; case 11: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 11); } break; case 12: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 13); } break; case 13: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 13); } break; case 14: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 11); } break; default: @@ -1094,7 +1092,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPM_LogWLn(); break; } - ConstOp__13_s = _s.lnk; + ConstOp__14_s = _s.lnk; } static void OPB_Convert (OPT_Node *x, OPT_Struct typ) @@ -1157,15 +1155,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__39 { INT16 *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__39 *lnk; +} *Op__39_s; -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__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1176,28 +1174,28 @@ static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) { 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; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 8; + if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 8; + *Op__39_s->g = 8; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 8; + *Op__39_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { + if ((*Op__39_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 == 8 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__39_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1213,11 +1211,11 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; INT64 val; - struct Op__38 _s; + struct Op__39 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__39_s; + Op__39_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1338,7 +1336,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 2: @@ -1357,7 +1355,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 3: do_ = 1; @@ -1380,7 +1378,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 4: @@ -1398,7 +1396,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1408,7 +1406,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1431,7 +1429,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 7: @@ -1440,7 +1438,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((f != 4 || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 8: @@ -1451,7 +1449,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1459,16 +1457,16 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1477,7 +1475,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); @@ -1487,7 +1485,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__39_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1672,6 +1670,19 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } +static void OPB_CheckWrite (OPT_Node x) +{ + if (x->readonly) { + OPB_err(76); + } + while (__IN(x->class, 0x74, 32)) { + x = x->left; + } + if ((x != NIL && x->obj != NIL)) { + x->obj->written = 1; + } +} + void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { INT16 f; @@ -1697,9 +1708,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if (f == 11) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); f = x->typ->BaseTyp->comp; if (__IN(f, 0x1c, 32)) { if (f == 3) { @@ -1855,8 +1864,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) OPB_err(112); } else if (f != 4) { OPB_err(111); - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 15: case 16: @@ -1865,8 +1874,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 17: @@ -1978,13 +1987,13 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) *par0 = x; } -static struct StPar1__53 { - struct StPar1__53 *lnk; -} *StPar1__53_s; +static struct StPar1__54 { + struct StPar1__54 *lnk; +} *StPar1__54_s; -static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__55 (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__55 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1999,9 +2008,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__53 _s; - _s.lnk = StPar1__53_s; - StPar1__53_s = &_s; + struct StPar1__54 _s; + _s.lnk = StPar1__54_s; + StPar1__54_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2017,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2028,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) 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); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2053,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__54(12, 19, p, x); + p = NewOp__55(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2069,13 +2078,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); t = x; x = p; p = t; - p = NewOp__54(19, 18, p, x); + p = NewOp__55(19, 18, p, x); } else { OPB_err(111); } @@ -2101,7 +2108,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) } p->obj = NIL; } else { - p = NewOp__54(12, 17, p, x); + p = NewOp__55(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2132,9 +2139,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__54(12, 27, p, x); + p = NewOp__55(12, 27, p, x); } else { - p = NewOp__54(12, 28, p, x); + p = NewOp__55(12, 28, p, x); } p->typ = p->left->typ; } @@ -2151,7 +2158,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) x = p; p = t; } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2161,7 +2168,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__54(12, 26, p, x); + p = NewOp__55(12, 26, p, x); } else { OPB_err(111); } @@ -2191,7 +2198,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__54(19, 30, p, x); + p = NewOp__55(19, 30, p, x); } else { OPB_err(111); } @@ -2237,7 +2244,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) break; } *par0 = p; - StPar1__53_s = _s.lnk; + StPar1__54_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) @@ -2356,7 +2363,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; - if (((fvarpar || sysflag != 0) && ftyp == OPT_bytetyp)) { + if (ftyp == OPT_bytetyp) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { if (__IN(18, OPM_Options, 32)) { OPB_err(-301); @@ -2426,9 +2433,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } else { OPB_CheckLeaf(ap, 0); } - if (ap->readonly) { - OPB_err(76); - } + OPB_CheckWrite(ap); if (fp->typ->comp == 3) { OPB_DynArrParCheck(fp->typ, ap->typ, 1); } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { @@ -2540,9 +2545,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_err(56); } OPB_CheckAssign((*x)->typ, y); - if ((*x)->readonly) { - OPB_err(76); - } + OPB_CheckWrite(*x); if ((*x)->typ->comp == 4) { if ((*x)->class == 5) { z = (*x)->left; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8277e38f..a81af7dd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0fdd8d5a..1fe12e58 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -141,7 +141,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; - __DUP(s, s__len, CHAR); ch = s[0]; i = 0; while (ch != 0x00) { @@ -153,7 +152,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) i += 1; ch = s[__X(i, s__len)]; } - __DEL(s); } static INT16 OPC_Length (CHAR *s, ADDRESS s__len) @@ -727,12 +725,10 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; - __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - __DEL(y); return y[__X(i, y__len)] == 0x00; } @@ -1466,7 +1462,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((var->typ->comp == 2 && var->mode == 1)) { + if ((((var->written && var->typ->comp == 2)) && var->mode == 1)) { OPC_BegStat(); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); @@ -1482,7 +1478,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && __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); @@ -1632,7 +1628,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } var = proc->link; while (var != NIL) { - if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && var->typ->comp == 3)) && var->mode == 1)) && var->typ->sysflag == 0)) { if (indent) { OPC_BegStat(); } else { @@ -1752,7 +1748,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; - __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { @@ -1773,7 +1768,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) i += 1; } OPM_Write('"'); - __DEL(s); } void OPC_Case (INT64 caseVal, INT16 form) diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 9753be69..dceec267 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index a1f841f0..c61bea4e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -112,9 +112,7 @@ void OPM_LogW (CHAR ch) void OPM_LogWStr (CHAR *s, ADDRESS s__len) { - __DUP(s, s__len, CHAR); Out_String(s, s__len); - __DEL(s); } void OPM_LogWNum (INT64 i, INT64 len) @@ -129,16 +127,13 @@ void OPM_LogWLn (void) void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { - __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { VT100_SetAttr(vt100code, vt100code__len); } - __DEL(vt100code); } void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) { - __DUP(modname, modname__len, CHAR); OPM_LogWStr((CHAR*)"Compiling ", 11); OPM_LogWStr(modname, modname__len); if (__IN(18, OPM_Options, 32)) { @@ -154,7 +149,6 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); } OPM_LogW('.'); - __DEL(modname); } INT64 OPM_SignedMaximum (INT32 bytecount) @@ -183,7 +177,6 @@ INT16 OPM_Integer (INT64 n) static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -263,7 +256,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) } i += 1; } - __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -338,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +402,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); @@ -492,7 +488,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES { INT16 i, j; CHAR ch; - __DUP(ext, ext__len, CHAR); i = 0; for (;;) { ch = name[__X(i, name__len)]; @@ -509,7 +504,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES i += 1; j += 1; } while (!(ch == 0x00)); - __DEL(ext); } static void OPM_LogErrMsg (INT16 n) @@ -1050,28 +1044,23 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { CHAR testpath[4096]; Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } - __DEL(s); return 1; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index da46f609..98d27008 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index b4ac155d..2e1431f4 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 73c8598f..73c2a584 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 664a235c..f69e0939 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index cb9bc36e..de90089e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b61a27bd..f9c229ee 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -77,7 +77,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 40dca306..fc2ce0c6 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -55,7 +55,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 6205abba..2256058f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ecd47da2..73d437e0 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 2db4d30c..b0771ca9 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 49eddd6f..82fbe7a1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 505d052e..a2835102 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -209,22 +209,18 @@ typedef BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { EnvPtr__83 p = NIL; - __DUP(var, var__len, CHAR); p = (EnvPtr__83)(ADDRESS)Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - __DEL(var); return p != NIL; } void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { val[0] = 0x00; } - __DEL(var); } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -280,8 +276,6 @@ void Platform_Delay (INT32 ms) INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { - __DUP(cmd, cmd__len, CHAR); - __DEL(cmd); return Platform_system(cmd, cmd__len); } @@ -358,16 +352,13 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden INT16 Platform_IdentifyByName (CHAR *n, ADDRESS n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - __DEL(n); return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - __DEL(n); return 0; } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index bc383cd6..a76b018d 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2636c568..7e623d5d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 222cb788..c839d865 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 22943103..a2b57ee8 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,7 +42,6 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; - __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; @@ -53,7 +52,6 @@ void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__ if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } - __DEL(extra); } void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) @@ -112,16 +110,13 @@ void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { - __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); Strings_Insert(source, source__len, pos, (void*)dest, dest__len); - __DEL(source); } void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; - __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { @@ -129,7 +124,6 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA } if (pos >= len) { dest[0] = 0x00; - __DEL(source); return; } i = 0; @@ -140,19 +134,14 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA i += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(source); } INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; - __DUP(pattern, pattern__len, CHAR); - __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - __DEL(pattern); - __DEL(s); return 0; } i = pos; @@ -163,15 +152,11 @@ INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, j += 1; } if (j == n2) { - __DEL(pattern); - __DEL(s); return i; } } i += 1; } - __DEL(pattern); - __DEL(s); return -1; } @@ -241,7 +226,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) INT16 p, e; REAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -295,7 +279,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) y = -y; } *r = y; - __DEL(s); } void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) @@ -303,7 +286,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) INT16 p, e; LONGREAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -357,7 +339,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) y = -y; } *r = y; - __DEL(s); } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 7ff642d1..21bf151b 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a961b700..3f10b0fc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1031,13 +1031,11 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { Texts_Write(&*W, W__typ, s[__X(i, s__len)]); i += 1; } - __DEL(s); } void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) @@ -1548,7 +1546,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) Texts_Piece p = NIL; CHAR tag, version; INT32 hlen; - __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { f = Files_New((CHAR*)"", 1); @@ -1593,7 +1590,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) T->cache = T->head; T->corg = 0; } - __DEL(name); } static struct Store__39 { @@ -1762,7 +1758,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) Files_Rider r; INT16 i, res; CHAR bak[64]; - __DUP(name, name__len, CHAR); f = Files_New(name, name__len); Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); @@ -1780,7 +1775,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) bak[__X(i + 4, 64)] = 0x00; Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); - __DEL(name); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index cac141d8..30f22cc0 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 54cdf683..81684069 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,44 +87,37 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; - __DUP(letter, letter__len, CHAR); __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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS 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); @@ -133,7 +126,6 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); Out_String(cmd, 12); - __DEL(letter); } void VT100_CUU (INT16 n) @@ -239,11 +231,9 @@ void VT100_DECTCEMh (void) void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; - __DUP(attr, attr__len, CHAR); __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); - __DEL(attr); } diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 579843b3..04fe2795 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 02e4cc5c..e3988ab0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -31,8 +31,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES { INT16 r, status, exitcode; extTools_CommandString fullcmd; - __DUP(title, title__len, CHAR); - __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); Out_String(cmd, cmd__len); @@ -66,8 +64,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES Modules_Halt(exitcode); } } - __DEL(title); - __DEL(cmd); } static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) @@ -84,19 +80,16 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; - __DUP(moduleName, moduleName__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); - __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { extTools_CommandString cmd; - __DUP(additionalopts, additionalopts__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); @@ -116,7 +109,6 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); - __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index eec380ca..2a14f64d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 323ddd74..f4e6ac7b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5e564e8f..eedf7323 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d389a56b..cf1ac609 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8311b466..96d5ca4b 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -123,7 +123,6 @@ static void Files_Assert (BOOLEAN truth) static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { - __DUP(s, s__len, CHAR); Out_Ln(); Out_String((CHAR*)"-- ", 4); Out_String(s, s__len); @@ -145,14 +144,11 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) } Out_Ln(); __HALT(99); - __DEL(s); } static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j, ld, ln; - __DUP(dir, dir__len, CHAR); - __DUP(name, name__len, CHAR); ld = Strings_Length(dir, dir__len); ln = Strings_Length(name, name__len); while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { @@ -177,14 +173,11 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS j += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(dir); - __DEL(name); } static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT16 i, n; - __DUP(finalName, finalName__len, CHAR); if (finalName[0] == '/') { __COPY(finalName, name, name__len); } else { @@ -219,7 +212,6 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; } name[__X(i, name__len)] = 0x00; - __DEL(finalName); } static void Files_Deregister (CHAR *name, ADDRESS name__len) @@ -227,7 +219,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) Platform_FileIdentity identity; Files_File osfile = NIL; INT16 error; - __DUP(name, name__len, CHAR); if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { osfile = (Files_File)Files_files; while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { @@ -246,7 +237,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) } } } - __DEL(name); } static void Files_Create (Files_File f) @@ -334,7 +324,6 @@ INT32 Files_Length (Files_File f) Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; - __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, 256); @@ -343,7 +332,6 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) f->len = 0; f->pos = 0; f->swapper = -1; - __DEL(name); return f; } @@ -1082,14 +1070,12 @@ static void Files_Finalize (SYSTEM_PTR o) void Files_SetSearchPath (CHAR *path, ADDRESS 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)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; } - __DEL(path); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1f9a4adc..985aae3e 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 3565a9ea..50c0d1d9 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,7 +151,6 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) { Heap_Module m, p; - __DUP(name, name__len, CHAR); m = (Heap_Module)(ADDRESS)Heap_modules; while ((m != NIL && __STRCMP(m->name, name) != 0)) { p = m; @@ -163,14 +162,11 @@ INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) } else { p->next = m->next; } - __DEL(name); return 0; } else { if (m == NIL) { - __DEL(name); return -1; } else { - __DEL(name); return m->refcnt; } } diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 67409408..f1b5e1b0 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e1f650f1..1693104b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -100,33 +100,28 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; - __DUP(s, s__len, CHAR); i = 0; Modules_GetArg(i, (void*)arg, 256); while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; Modules_GetArg(i, (void*)arg, 256); } - __DEL(s); return i; } static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return i; } static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); while (s[__X(i, s__len)] != 0x00) { @@ -135,13 +130,11 @@ static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); if ((j > 0 && d[__X(j - 1, d__len)] != c)) { @@ -154,69 +147,54 @@ static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRES j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); if (c == 0x00) { - __DEL(s); return 0; } i = 0; while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return s[__X(i, s__len)] == c; } static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) { - __DUP(d, d__len, CHAR); if (d[0] == 0x00) { - __DEL(d); return 0; } if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { - __DEL(d); return 1; } if (d[__X(1, d__len)] == ':') { - __DEL(d); return 1; } - __DEL(d); return 0; } static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { - __DUP(s, s__len, CHAR); if (Modules_IsAbsolute(s, s__len)) { __COPY(s, d, d__len); } else { __COPY(Platform_CWD, d, d__len); Modules_AppendPart('/', s, s__len, (void*)d, d__len); } - __DEL(s); } static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) { Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); - __DEL(s); return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; } static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) { INT16 j; - __DUP(s, s__len, CHAR); - __DUP(p, p__len, CHAR); j = 0; while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { d[__X(j, d__len)] = s[__X(*i, s__len)]; @@ -227,15 +205,12 @@ static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADD while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { *i += 1; } - __DEL(s); - __DEL(p); } static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; CHAR part[1024]; - __DUP(s, s__len, CHAR); i = 0; j = 0; while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { @@ -250,7 +225,6 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) Modules_AppendPart('/', part, 1024, (void*)d, d__len); } } - __DEL(s); } typedef @@ -306,7 +280,6 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Heap_Module m = NIL; CHAR bodyname[64]; Heap_Command body; - __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { m = m->next; @@ -321,14 +294,12 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } - __DEL(name); return m; } Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { Heap_Cmd c = NIL; - __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { c = c->next; @@ -336,7 +307,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - __DEL(name); return c->cmd; } else { Modules_res = 2; @@ -346,7 +316,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); - __DEL(name); return NIL; } __RETCHK; @@ -356,7 +325,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Heap_Module m = NIL, p = NIL; INT32 refcount; - __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; @@ -374,7 +342,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) Modules_res = 1; } } - __DEL(name); } static void Modules_errch (CHAR c) @@ -386,13 +353,11 @@ static void Modules_errch (CHAR c) static void Modules_errstring (CHAR *s, ADDRESS 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_errint (INT32 l) diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ea8cdc50..1f4d96a9 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d05cb9ca..7398864a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,6 +27,7 @@ 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_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_CheckWrite (OPT_Node x); 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); @@ -101,9 +102,6 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - if ((((obj->mode == 1 && __IN(obj->typ->comp, 0x0c, 32))) && obj->typ->sysflag != 0)) { - node->readonly = 1; - } return node; } @@ -359,16 +357,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__58 { +static struct TypTest__59 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__58 *lnk; -} *TypTest__58_s; + struct TypTest__59 *lnk; +} *TypTest__59_s; -static void GTT__59 (OPT_Struct t0, OPT_Struct t1); +static void GTT__60 (OPT_Struct t0, OPT_Struct t1); -static void GTT__59 (OPT_Struct t0, OPT_Struct t1) +static void GTT__60 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -381,54 +379,54 @@ static void GTT__59 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - 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; + if (*TypTest__59_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__59_s->x, NIL); + (*TypTest__59_s->x)->readonly = (*TypTest__59_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__58_s->guard) { - if ((*TypTest__58_s->x)->class == 5) { + } else if (!*TypTest__59_s->guard) { + if ((*TypTest__59_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } else { - *TypTest__58_s->x = OPB_NewBoolConst(1); + *TypTest__59_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__58 _s; + struct TypTest__59 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__58_s; - TypTest__58_s = &_s; + _s.lnk = TypTest__59_s; + TypTest__59_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__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__60((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__59((*x)->typ, obj->typ); + GTT__60((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -437,7 +435,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__58_s = _s.lnk; + TypTest__59_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -501,13 +499,13 @@ static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__29 { + struct MOp__29 *lnk; +} *MOp__29_s; -static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__30 (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__30 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -522,9 +520,9 @@ void OPB_MOp (INT8 op, OPT_Node *x) INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__29 _s; + _s.lnk = MOp__29_s; + MOp__29_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -538,7 +536,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(98); @@ -570,7 +568,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(97); @@ -591,7 +589,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -603,7 +601,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -616,7 +614,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -629,7 +627,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) f = 8; } if (z->class < 7 || f == 8) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(127); } @@ -638,7 +636,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 25: if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(219); } @@ -655,7 +653,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__29_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -742,65 +740,65 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) } } -static struct ConstOp__13 { +static struct ConstOp__14 { OPT_Node *x; INT16 *f; OPT_Const *xval, *yval; - struct ConstOp__13 *lnk; -} *ConstOp__13_s; + struct ConstOp__14 *lnk; +} *ConstOp__14_s; -static INT16 ConstCmp__14 (void); +static INT16 ConstCmp__15 (void); -static INT16 ConstCmp__14 (void) +static INT16 ConstCmp__15 (void) { INT16 res; - switch (*ConstOp__13_s->f) { + switch (*ConstOp__14_s->f) { case 0: res = 9; break; case 1: case 3: case 4: - if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval < (*ConstOp__14_s->yval)->intval) { res = 11; - } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + } else if ((*ConstOp__14_s->xval)->intval > (*ConstOp__14_s->yval)->intval) { res = 13; } else { res = 9; } break; case 5: case 6: - if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + if ((*ConstOp__14_s->xval)->realval < (*ConstOp__14_s->yval)->realval) { res = 11; - } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + } else if ((*ConstOp__14_s->xval)->realval > (*ConstOp__14_s->yval)->realval) { res = 13; } else { res = 9; } break; case 2: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; } break; case 7: - if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + if ((*ConstOp__14_s->xval)->setval != (*ConstOp__14_s->yval)->setval) { res = 10; } else { res = 9; } break; case 8: - if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) < 0) { res = 11; - } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + } else if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) > 0) { res = 13; } else { res = 9; } break; case 9: case 11: case 12: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; @@ -808,11 +806,11 @@ static INT16 ConstCmp__14 (void) break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); - OPM_LogWNum(*ConstOp__13_s->f, 0); + OPM_LogWNum(*ConstOp__14_s->f, 0); OPM_LogWLn(); break; } - (*ConstOp__13_s->x)->typ = OPT_booltyp; + (*ConstOp__14_s->x)->typ = OPT_booltyp; return res; } @@ -822,13 +820,13 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPT_Const xval = NIL, yval = NIL; INT64 xv, yv; BOOLEAN temp; - struct ConstOp__13 _s; + struct ConstOp__14 _s; _s.x = &x; _s.f = &f; _s.xval = &xval; _s.yval = &yval; - _s.lnk = ConstOp__13_s; - ConstOp__13_s = &_s; + _s.lnk = ConstOp__14_s; + ConstOp__14_s = &_s; f = x->typ->form; g = y->typ->form; xval = x->conval; @@ -1055,37 +1053,37 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) } break; case 9: - xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 9); break; case 10: - xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 9); break; case 11: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 11); } break; case 12: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 13); } break; case 13: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 13); } break; case 14: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 11); } break; default: @@ -1094,7 +1092,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPM_LogWLn(); break; } - ConstOp__13_s = _s.lnk; + ConstOp__14_s = _s.lnk; } static void OPB_Convert (OPT_Node *x, OPT_Struct typ) @@ -1157,15 +1155,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__39 { INT16 *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__39 *lnk; +} *Op__39_s; -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__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1176,28 +1174,28 @@ static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) { 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; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 8; + if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 8; + *Op__39_s->g = 8; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 8; + *Op__39_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { + if ((*Op__39_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 == 8 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__39_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1213,11 +1211,11 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; INT64 val; - struct Op__38 _s; + struct Op__39 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__39_s; + Op__39_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1338,7 +1336,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 2: @@ -1357,7 +1355,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 3: do_ = 1; @@ -1380,7 +1378,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 4: @@ -1398,7 +1396,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1408,7 +1406,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1431,7 +1429,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 7: @@ -1440,7 +1438,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((f != 4 || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 8: @@ -1451,7 +1449,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1459,16 +1457,16 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1477,7 +1475,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); @@ -1487,7 +1485,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__39_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1672,6 +1670,19 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } +static void OPB_CheckWrite (OPT_Node x) +{ + if (x->readonly) { + OPB_err(76); + } + while (__IN(x->class, 0x74, 32)) { + x = x->left; + } + if ((x != NIL && x->obj != NIL)) { + x->obj->written = 1; + } +} + void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { INT16 f; @@ -1697,9 +1708,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if (f == 11) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); f = x->typ->BaseTyp->comp; if (__IN(f, 0x1c, 32)) { if (f == 3) { @@ -1855,8 +1864,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) OPB_err(112); } else if (f != 4) { OPB_err(111); - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 15: case 16: @@ -1865,8 +1874,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 17: @@ -1978,13 +1987,13 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) *par0 = x; } -static struct StPar1__53 { - struct StPar1__53 *lnk; -} *StPar1__53_s; +static struct StPar1__54 { + struct StPar1__54 *lnk; +} *StPar1__54_s; -static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__55 (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__55 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1999,9 +2008,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__53 _s; - _s.lnk = StPar1__53_s; - StPar1__53_s = &_s; + struct StPar1__54 _s; + _s.lnk = StPar1__54_s; + StPar1__54_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2017,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2028,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) 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); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2053,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__54(12, 19, p, x); + p = NewOp__55(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2069,13 +2078,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); t = x; x = p; p = t; - p = NewOp__54(19, 18, p, x); + p = NewOp__55(19, 18, p, x); } else { OPB_err(111); } @@ -2101,7 +2108,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) } p->obj = NIL; } else { - p = NewOp__54(12, 17, p, x); + p = NewOp__55(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2132,9 +2139,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__54(12, 27, p, x); + p = NewOp__55(12, 27, p, x); } else { - p = NewOp__54(12, 28, p, x); + p = NewOp__55(12, 28, p, x); } p->typ = p->left->typ; } @@ -2151,7 +2158,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) x = p; p = t; } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2161,7 +2168,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__54(12, 26, p, x); + p = NewOp__55(12, 26, p, x); } else { OPB_err(111); } @@ -2191,7 +2198,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__54(19, 30, p, x); + p = NewOp__55(19, 30, p, x); } else { OPB_err(111); } @@ -2237,7 +2244,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) break; } *par0 = p; - StPar1__53_s = _s.lnk; + StPar1__54_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) @@ -2356,7 +2363,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; - if (((fvarpar || sysflag != 0) && ftyp == OPT_bytetyp)) { + if (ftyp == OPT_bytetyp) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { if (__IN(18, OPM_Options, 32)) { OPB_err(-301); @@ -2426,9 +2433,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } else { OPB_CheckLeaf(ap, 0); } - if (ap->readonly) { - OPB_err(76); - } + OPB_CheckWrite(ap); if (fp->typ->comp == 3) { OPB_DynArrParCheck(fp->typ, ap->typ, 1); } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { @@ -2540,9 +2545,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_err(56); } OPB_CheckAssign((*x)->typ, y); - if ((*x)->readonly) { - OPB_err(76); - } + OPB_CheckWrite(*x); if ((*x)->typ->comp == 4) { if ((*x)->class == 5) { z = (*x)->left; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8277e38f..a81af7dd 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0fdd8d5a..1fe12e58 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -141,7 +141,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; - __DUP(s, s__len, CHAR); ch = s[0]; i = 0; while (ch != 0x00) { @@ -153,7 +152,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) i += 1; ch = s[__X(i, s__len)]; } - __DEL(s); } static INT16 OPC_Length (CHAR *s, ADDRESS s__len) @@ -727,12 +725,10 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; - __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - __DEL(y); return y[__X(i, y__len)] == 0x00; } @@ -1466,7 +1462,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((var->typ->comp == 2 && var->mode == 1)) { + if ((((var->written && var->typ->comp == 2)) && var->mode == 1)) { OPC_BegStat(); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); @@ -1482,7 +1478,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && __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); @@ -1632,7 +1628,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } var = proc->link; while (var != NIL) { - if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && var->typ->comp == 3)) && var->mode == 1)) && var->typ->sysflag == 0)) { if (indent) { OPC_BegStat(); } else { @@ -1752,7 +1748,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; - __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { @@ -1773,7 +1768,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) i += 1; } OPM_Write('"'); - __DEL(s); } void OPC_Case (INT64 caseVal, INT16 form) diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 9753be69..dceec267 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ab64f723..fb2bb9f9 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -112,9 +112,7 @@ void OPM_LogW (CHAR ch) void OPM_LogWStr (CHAR *s, ADDRESS s__len) { - __DUP(s, s__len, CHAR); Out_String(s, s__len); - __DEL(s); } void OPM_LogWNum (INT64 i, INT64 len) @@ -129,16 +127,13 @@ void OPM_LogWLn (void) void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { - __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { VT100_SetAttr(vt100code, vt100code__len); } - __DEL(vt100code); } void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) { - __DUP(modname, modname__len, CHAR); OPM_LogWStr((CHAR*)"Compiling ", 11); OPM_LogWStr(modname, modname__len); if (__IN(18, OPM_Options, 32)) { @@ -154,7 +149,6 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); } OPM_LogW('.'); - __DEL(modname); } INT64 OPM_SignedMaximum (INT32 bytecount) @@ -183,7 +177,6 @@ INT16 OPM_Integer (INT64 n) static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -263,7 +256,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) } i += 1; } - __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -338,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +402,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); @@ -492,7 +488,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES { INT16 i, j; CHAR ch; - __DUP(ext, ext__len, CHAR); i = 0; for (;;) { ch = name[__X(i, name__len)]; @@ -509,7 +504,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES i += 1; j += 1; } while (!(ch == 0x00)); - __DEL(ext); } static void OPM_LogErrMsg (INT16 n) @@ -1050,28 +1044,23 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { CHAR testpath[4096]; Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } - __DEL(s); return 1; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index da46f609..98d27008 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ff4688fb..6f42624f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 73c8598f..73c2a584 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 664a235c..f69e0939 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index cb9bc36e..de90089e 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 5a01a9e2..2dff5173 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -77,7 +77,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 40dca306..fc2ce0c6 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -55,7 +55,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 55f230a1..89d4c32d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ecd47da2..73d437e0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 784a60ca..1d926aca 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 49eddd6f..82fbe7a1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 0ab458fa..5a8dcbb6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -218,14 +218,11 @@ BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__le { 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); - __DEL(var); return 1; } else { - __DEL(var); return 0; } __RETCHK; @@ -233,11 +230,9 @@ BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__le void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { val[0] = 0x00; } - __DEL(var); } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -287,7 +282,6 @@ void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { INT16 result; - __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); Platform_processInfo(); @@ -297,7 +291,6 @@ INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) } Platform_cleanupProcess(); } - __DEL(cmd); return __ASHL(result, 8); } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 94aaab63..66ee9f36 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2636c568..7e623d5d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 222cb788..c839d865 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 22943103..a2b57ee8 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,7 +42,6 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; - __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; @@ -53,7 +52,6 @@ void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__ if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } - __DEL(extra); } void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) @@ -112,16 +110,13 @@ void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { - __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); Strings_Insert(source, source__len, pos, (void*)dest, dest__len); - __DEL(source); } void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; - __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { @@ -129,7 +124,6 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA } if (pos >= len) { dest[0] = 0x00; - __DEL(source); return; } i = 0; @@ -140,19 +134,14 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA i += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(source); } INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; - __DUP(pattern, pattern__len, CHAR); - __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - __DEL(pattern); - __DEL(s); return 0; } i = pos; @@ -163,15 +152,11 @@ INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, j += 1; } if (j == n2) { - __DEL(pattern); - __DEL(s); return i; } } i += 1; } - __DEL(pattern); - __DEL(s); return -1; } @@ -241,7 +226,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) INT16 p, e; REAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -295,7 +279,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) y = -y; } *r = y; - __DEL(s); } void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) @@ -303,7 +286,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) INT16 p, e; LONGREAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -357,7 +339,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) y = -y; } *r = y; - __DEL(s); } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 7ff642d1..21bf151b 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index d335e885..9c01a7b5 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1031,13 +1031,11 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { Texts_Write(&*W, W__typ, s[__X(i, s__len)]); i += 1; } - __DEL(s); } void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) @@ -1548,7 +1546,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) Texts_Piece p = NIL; CHAR tag, version; INT32 hlen; - __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { f = Files_New((CHAR*)"", 1); @@ -1593,7 +1590,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) T->cache = T->head; T->corg = 0; } - __DEL(name); } static struct Store__39 { @@ -1762,7 +1758,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) Files_Rider r; INT16 i, res; CHAR bak[64]; - __DUP(name, name__len, CHAR); f = Files_New(name, name__len); Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); @@ -1780,7 +1775,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) bak[__X(i + 4, 64)] = 0x00; Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); - __DEL(name); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 26975686..e7ebbd80 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 54cdf683..81684069 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,44 +87,37 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; - __DUP(letter, letter__len, CHAR); __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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS 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); @@ -133,7 +126,6 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); Out_String(cmd, 12); - __DEL(letter); } void VT100_CUU (INT16 n) @@ -239,11 +231,9 @@ void VT100_DECTCEMh (void) void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; - __DUP(attr, attr__len, CHAR); __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); - __DEL(attr); } diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 579843b3..04fe2795 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 02e4cc5c..e3988ab0 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -31,8 +31,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES { INT16 r, status, exitcode; extTools_CommandString fullcmd; - __DUP(title, title__len, CHAR); - __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); Out_String(cmd, cmd__len); @@ -66,8 +64,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES Modules_Halt(exitcode); } } - __DEL(title); - __DEL(cmd); } static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) @@ -84,19 +80,16 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; - __DUP(moduleName, moduleName__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); - __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { extTools_CommandString cmd; - __DUP(additionalopts, additionalopts__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); @@ -116,7 +109,6 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); - __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index eec380ca..2a14f64d 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 323ddd74..f4e6ac7b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -89,7 +89,7 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; - switch (OPM_LongintSize) { + switch (OPM_SetSize) { case 4: OPT_settyp = OPT_set32typ; break; diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5e564e8f..eedf7323 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); + __MOVE("2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 76); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d389a56b..cf1ac609 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5f2dc4a8..3e5f32ad 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -124,7 +124,6 @@ static void Files_Assert (BOOLEAN truth) static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) { - __DUP(s, s__len, CHAR); Out_Ln(); Out_String((CHAR*)"-- ", 4); Out_String(s, s__len); @@ -146,14 +145,11 @@ static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode) } Out_Ln(); __HALT(99); - __DEL(s); } static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS name__len, CHAR *dest, ADDRESS dest__len) { INT16 i, j, ld, ln; - __DUP(dir, dir__len, CHAR); - __DUP(name, name__len, CHAR); ld = Strings_Length(dir, dir__len); ln = Strings_Length(name, name__len); while ((ld > 0 && dir[__X(ld - 1, dir__len)] == '/')) { @@ -178,14 +174,11 @@ static void Files_MakeFileName (CHAR *dir, ADDRESS dir__len, CHAR *name, ADDRESS j += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(dir); - __DEL(name); } static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *name, ADDRESS name__len) { INT16 i, n; - __DUP(finalName, finalName__len, CHAR); if (finalName[0] == '/') { __COPY(finalName, name, name__len); } else { @@ -220,7 +213,6 @@ static void Files_GetTempName (CHAR *finalName, ADDRESS finalName__len, CHAR *na i += 1; } name[__X(i, name__len)] = 0x00; - __DEL(finalName); } static void Files_Deregister (CHAR *name, ADDRESS name__len) @@ -228,7 +220,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) Platform_FileIdentity identity; Files_File osfile = NIL; INT16 error; - __DUP(name, name__len, CHAR); if (Platform_IdentifyByName(name, name__len, &identity, Platform_FileIdentity__typ) == 0) { osfile = (Files_File)Files_files; while ((osfile != NIL && !Platform_SameFile(osfile->identity, identity))) { @@ -247,7 +238,6 @@ static void Files_Deregister (CHAR *name, ADDRESS name__len) } } } - __DEL(name); } static void Files_Create (Files_File f) @@ -335,7 +325,6 @@ INT32 Files_Length (Files_File f) Files_File Files_New (CHAR *name, ADDRESS name__len) { Files_File f = NIL; - __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; __COPY(name, f->registerName, 256); @@ -344,7 +333,6 @@ Files_File Files_New (CHAR *name, ADDRESS name__len) f->len = 0; f->pos = 0; f->swapper = -1; - __DEL(name); return f; } @@ -1084,14 +1072,12 @@ static void Files_Finalize (SYSTEM_PTR o) void Files_SetSearchPath (CHAR *path, ADDRESS 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)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; } - __DEL(path); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9889f240..f634a3be 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 2849cbd2..bbfbc892 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -151,7 +151,6 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) { Heap_Module m, p; - __DUP(name, name__len, CHAR); m = (Heap_Module)(ADDRESS)Heap_modules; while ((m != NIL && __STRCMP(m->name, name) != 0)) { p = m; @@ -163,14 +162,11 @@ INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len) } else { p->next = m->next; } - __DEL(name); return 0; } else { if (m == NIL) { - __DEL(name); return -1; } else { - __DEL(name); return m->refcnt; } } diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index bcf0a8c8..75ea9537 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. rtsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 830eed33..629b651a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -100,33 +100,28 @@ INT16 Modules_ArgPos (CHAR *s, ADDRESS s__len) { INT16 i; CHAR arg[256]; - __DUP(s, s__len, CHAR); i = 0; Modules_GetArg(i, (void*)arg, 256); while ((i < Modules_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; Modules_GetArg(i, (void*)arg, 256); } - __DEL(s); return i; } static INT16 Modules_CharCount (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return i; } static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); while (s[__X(i, s__len)] != 0x00) { @@ -135,13 +130,11 @@ static void Modules_Append (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; - __DUP(s, s__len, CHAR); i = 0; j = Modules_CharCount(d, d__len); if ((j > 0 && d[__X(j - 1, d__len)] != c)) { @@ -154,69 +147,54 @@ static void Modules_AppendPart (CHAR c, CHAR *s, ADDRESS s__len, CHAR *d, ADDRES j += 1; } d[__X(j, d__len)] = 0x00; - __DEL(s); } static BOOLEAN Modules_IsOneOf (CHAR c, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); if (c == 0x00) { - __DEL(s); return 0; } i = 0; while ((s[__X(i, s__len)] != c && s[__X(i, s__len)] != 0x00)) { i += 1; } - __DEL(s); return s[__X(i, s__len)] == c; } static BOOLEAN Modules_IsAbsolute (CHAR *d, ADDRESS d__len) { - __DUP(d, d__len, CHAR); if (d[0] == 0x00) { - __DEL(d); return 0; } if (Modules_IsOneOf(d[0], (CHAR*)"/\\", 3)) { - __DEL(d); return 1; } if (d[__X(1, d__len)] == ':') { - __DEL(d); return 1; } - __DEL(d); return 0; } static void Modules_Canonify (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { - __DUP(s, s__len, CHAR); if (Modules_IsAbsolute(s, s__len)) { __COPY(s, d, d__len); } else { __COPY(Platform_CWD, d, d__len); Modules_AppendPart('/', s, s__len, (void*)d, d__len); } - __DEL(s); } static BOOLEAN Modules_IsFilePresent (CHAR *s, ADDRESS s__len) { Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); - __DEL(s); return Platform_IdentifyByName(s, s__len, &identity, Platform_FileIdentity__typ) == 0; } static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADDRESS p__len, CHAR *d, ADDRESS d__len) { INT16 j; - __DUP(s, s__len, CHAR); - __DUP(p, p__len, CHAR); j = 0; while ((s[__X(*i, s__len)] != 0x00 && !Modules_IsOneOf(s[__X(*i, s__len)], p, p__len))) { d[__X(j, d__len)] = s[__X(*i, s__len)]; @@ -227,15 +205,12 @@ static void Modules_ExtractPart (CHAR *s, ADDRESS s__len, INT16 *i, CHAR *p, ADD while (Modules_IsOneOf(s[__X(*i, s__len)], p, p__len)) { *i += 1; } - __DEL(s); - __DEL(p); } static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) { INT16 i, j; CHAR part[1024]; - __DUP(s, s__len, CHAR); i = 0; j = 0; while ((i < 2 && Modules_IsOneOf(s[__X(i, s__len)], (CHAR*)"/\\", 3))) { @@ -250,7 +225,6 @@ static void Modules_Trim (CHAR *s, ADDRESS s__len, CHAR *d, ADDRESS d__len) Modules_AppendPart('/', part, 1024, (void*)d, d__len); } } - __DEL(s); } typedef @@ -306,7 +280,6 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Heap_Module m = NIL; CHAR bodyname[64]; Heap_Command body; - __DUP(name, name__len, CHAR); m = Modules_modules(); while ((m != NIL && __STRCMP(m->name, name) != 0)) { m = m->next; @@ -321,14 +294,12 @@ Heap_Module Modules_ThisMod (CHAR *name, ADDRESS name__len) Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); } - __DEL(name); return m; } Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len) { Heap_Cmd c = NIL; - __DUP(name, name__len, CHAR); c = mod->cmds; while ((c != NIL && __STRCMP(c->name, name) != 0)) { c = c->next; @@ -336,7 +307,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - __DEL(name); return c->cmd; } else { Modules_res = 2; @@ -346,7 +316,6 @@ Heap_Command Modules_ThisCommand (Heap_Module mod, CHAR *name, ADDRESS name__len Modules_Append((CHAR*)".", 2, (void*)Modules_resMsg, 256); Modules_Append(name, name__len, (void*)Modules_resMsg, 256); Modules_Append((CHAR*)"\" not found", 12, (void*)Modules_resMsg, 256); - __DEL(name); return NIL; } __RETCHK; @@ -356,7 +325,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) { Heap_Module m = NIL, p = NIL; INT32 refcount; - __DUP(name, name__len, CHAR); m = Modules_modules(); if (all) { Modules_res = 1; @@ -374,7 +342,6 @@ void Modules_Free (CHAR *name, ADDRESS name__len, BOOLEAN all) Modules_res = 1; } } - __DEL(name); } static void Modules_errch (CHAR c) @@ -386,13 +353,11 @@ static void Modules_errch (CHAR c) static void Modules_errstring (CHAR *s, ADDRESS 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_errint (INT32 l) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d95e7a49..8a733e88 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d05cb9ca..7398864a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,6 +27,7 @@ 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_CheckReceiver (OPT_Node *x, OPT_Object fp); +static void OPB_CheckWrite (OPT_Node x); 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); @@ -101,9 +102,6 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - if ((((obj->mode == 1 && __IN(obj->typ->comp, 0x0c, 32))) && obj->typ->sysflag != 0)) { - node->readonly = 1; - } return node; } @@ -359,16 +357,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__58 { +static struct TypTest__59 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__58 *lnk; -} *TypTest__58_s; + struct TypTest__59 *lnk; +} *TypTest__59_s; -static void GTT__59 (OPT_Struct t0, OPT_Struct t1); +static void GTT__60 (OPT_Struct t0, OPT_Struct t1); -static void GTT__59 (OPT_Struct t0, OPT_Struct t1) +static void GTT__60 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -381,54 +379,54 @@ static void GTT__59 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - 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; + if (*TypTest__59_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__59_s->x, NIL); + (*TypTest__59_s->x)->readonly = (*TypTest__59_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__58_s->guard) { - if ((*TypTest__58_s->x)->class == 5) { + } else if (!*TypTest__59_s->guard) { + if ((*TypTest__59_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__58_s->x; - node->obj = *TypTest__58_s->obj; - *TypTest__58_s->x = node; + node->left = *TypTest__59_s->x; + node->obj = *TypTest__59_s->obj; + *TypTest__59_s->x = node; } else { - *TypTest__58_s->x = OPB_NewBoolConst(1); + *TypTest__59_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__58 _s; + struct TypTest__59 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__58_s; - TypTest__58_s = &_s; + _s.lnk = TypTest__59_s; + TypTest__59_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__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__60((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__59((*x)->typ, obj->typ); + GTT__60((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -437,7 +435,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__58_s = _s.lnk; + TypTest__59_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -501,13 +499,13 @@ static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) x->intval = -1; } -static struct MOp__28 { - struct MOp__28 *lnk; -} *MOp__28_s; +static struct MOp__29 { + struct MOp__29 *lnk; +} *MOp__29_s; -static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__30 (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__30 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -522,9 +520,9 @@ void OPB_MOp (INT8 op, OPT_Node *x) INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__28 _s; - _s.lnk = MOp__28_s; - MOp__28_s = &_s; + struct MOp__29 _s; + _s.lnk = MOp__29_s; + MOp__29_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -538,7 +536,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(98); @@ -570,7 +568,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(97); @@ -591,7 +589,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -603,7 +601,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = (INT16)__CAP(__CHR(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -616,7 +614,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } } else { OPB_err(111); @@ -629,7 +627,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) f = 8; } if (z->class < 7 || f == 8) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(127); } @@ -638,7 +636,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) case 25: if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__29(op, typ, z); + z = NewOp__30(op, typ, z); } else { OPB_err(219); } @@ -655,7 +653,7 @@ void OPB_MOp (INT8 op, OPT_Node *x) } } *x = z; - MOp__28_s = _s.lnk; + MOp__29_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -742,65 +740,65 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) } } -static struct ConstOp__13 { +static struct ConstOp__14 { OPT_Node *x; INT16 *f; OPT_Const *xval, *yval; - struct ConstOp__13 *lnk; -} *ConstOp__13_s; + struct ConstOp__14 *lnk; +} *ConstOp__14_s; -static INT16 ConstCmp__14 (void); +static INT16 ConstCmp__15 (void); -static INT16 ConstCmp__14 (void) +static INT16 ConstCmp__15 (void) { INT16 res; - switch (*ConstOp__13_s->f) { + switch (*ConstOp__14_s->f) { case 0: res = 9; break; case 1: case 3: case 4: - if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval < (*ConstOp__14_s->yval)->intval) { res = 11; - } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { + } else if ((*ConstOp__14_s->xval)->intval > (*ConstOp__14_s->yval)->intval) { res = 13; } else { res = 9; } break; case 5: case 6: - if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { + if ((*ConstOp__14_s->xval)->realval < (*ConstOp__14_s->yval)->realval) { res = 11; - } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { + } else if ((*ConstOp__14_s->xval)->realval > (*ConstOp__14_s->yval)->realval) { res = 13; } else { res = 9; } break; case 2: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; } break; case 7: - if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { + if ((*ConstOp__14_s->xval)->setval != (*ConstOp__14_s->yval)->setval) { res = 10; } else { res = 9; } break; case 8: - if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { + if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) < 0) { res = 11; - } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { + } else if (__STRCMP(*(*ConstOp__14_s->xval)->ext, *(*ConstOp__14_s->yval)->ext) > 0) { res = 13; } else { res = 9; } break; case 9: case 11: case 12: - if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { + if ((*ConstOp__14_s->xval)->intval != (*ConstOp__14_s->yval)->intval) { res = 10; } else { res = 9; @@ -808,11 +806,11 @@ static INT16 ConstCmp__14 (void) break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); - OPM_LogWNum(*ConstOp__13_s->f, 0); + OPM_LogWNum(*ConstOp__14_s->f, 0); OPM_LogWLn(); break; } - (*ConstOp__13_s->x)->typ = OPT_booltyp; + (*ConstOp__14_s->x)->typ = OPT_booltyp; return res; } @@ -822,13 +820,13 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPT_Const xval = NIL, yval = NIL; INT64 xv, yv; BOOLEAN temp; - struct ConstOp__13 _s; + struct ConstOp__14 _s; _s.x = &x; _s.f = &f; _s.xval = &xval; _s.yval = &yval; - _s.lnk = ConstOp__13_s; - ConstOp__13_s = &_s; + _s.lnk = ConstOp__14_s; + ConstOp__14_s = &_s; f = x->typ->form; g = y->typ->form; xval = x->conval; @@ -1055,37 +1053,37 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) } break; case 9: - xval->intval = OPB_BoolToInt(ConstCmp__14() == 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 9); break; case 10: - xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 9); break; case 11: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 11); } break; case 12: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 13); } break; case 13: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); + xval->intval = OPB_BoolToInt(ConstCmp__15() == 13); } break; case 14: if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { - xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); + xval->intval = OPB_BoolToInt(ConstCmp__15() != 11); } break; default: @@ -1094,7 +1092,7 @@ static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) OPM_LogWLn(); break; } - ConstOp__13_s = _s.lnk; + ConstOp__14_s = _s.lnk; } static void OPB_Convert (OPT_Node *x, OPT_Struct typ) @@ -1157,15 +1155,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__38 { +static struct Op__39 { INT16 *f, *g; - struct Op__38 *lnk; -} *Op__38_s; + struct Op__39 *lnk; +} *Op__39_s; -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__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__40 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1176,28 +1174,28 @@ static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) { 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; - if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 8; + if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 8; + *Op__39_s->g = 8; yCharArr = 1; } - if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 8; + *Op__39_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { + if ((*Op__39_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 == 8 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__39_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1213,11 +1211,11 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; INT64 val; - struct Op__38 _s; + struct Op__39 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__38_s; - Op__38_s = &_s; + _s.lnk = Op__39_s; + Op__39_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1338,7 +1336,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 2: @@ -1357,7 +1355,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 3: do_ = 1; @@ -1380,7 +1378,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 4: @@ -1398,7 +1396,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1408,7 +1406,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1431,7 +1429,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 7: @@ -1440,7 +1438,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((f != 4 || y->class != 7) || y->conval->intval != 0) { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } break; case 8: @@ -1451,7 +1449,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1459,16 +1457,16 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__42(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1477,7 +1475,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__39(op, typ, &z, y); + NewOp__40(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); @@ -1487,7 +1485,7 @@ void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__38_s = _s.lnk; + Op__39_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1672,6 +1670,19 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } +static void OPB_CheckWrite (OPT_Node x) +{ + if (x->readonly) { + OPB_err(76); + } + while (__IN(x->class, 0x74, 32)) { + x = x->left; + } + if ((x != NIL && x->obj != NIL)) { + x->obj->written = 1; + } +} + void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { INT16 f; @@ -1697,9 +1708,7 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if (f == 11) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); f = x->typ->BaseTyp->comp; if (__IN(f, 0x1c, 32)) { if (f == 3) { @@ -1855,8 +1864,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) OPB_err(112); } else if (f != 4) { OPB_err(111); - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 15: case 16: @@ -1865,8 +1874,8 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; - } else if (x->readonly) { - OPB_err(76); + } else { + OPB_CheckWrite(x); } break; case 17: @@ -1978,13 +1987,13 @@ void OPB_StPar0 (OPT_Node *par0, INT16 fctno) *par0 = x; } -static struct StPar1__53 { - struct StPar1__53 *lnk; -} *StPar1__53_s; +static struct StPar1__54 { + struct StPar1__54 *lnk; +} *StPar1__54_s; -static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__55 (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__55 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1999,9 +2008,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__53 _s; - _s.lnk = StPar1__53_s; - StPar1__53_s = &_s; + struct StPar1__54 _s; + _s.lnk = StPar1__54_s; + StPar1__54_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2017,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2028,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) 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); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2053,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__54(12, 19, p, x); + p = NewOp__55(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2069,13 +2078,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (OPB_NotVar(x)) { OPB_err(112); } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { - if (x->readonly) { - OPB_err(76); - } + OPB_CheckWrite(x); t = x; x = p; p = t; - p = NewOp__54(19, 18, p, x); + p = NewOp__55(19, 18, p, x); } else { OPB_err(111); } @@ -2101,7 +2108,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) } p->obj = NIL; } else { - p = NewOp__54(12, 17, p, x); + p = NewOp__55(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2132,9 +2139,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__54(12, 27, p, x); + p = NewOp__55(12, 27, p, x); } else { - p = NewOp__54(12, 28, p, x); + p = NewOp__55(12, 28, p, x); } p->typ = p->left->typ; } @@ -2151,7 +2158,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) x = p; p = t; } - p = NewOp__54(19, fctno, p, x); + p = NewOp__55(19, fctno, p, x); } else { OPB_err(111); } @@ -2161,7 +2168,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__54(12, 26, p, x); + p = NewOp__55(12, 26, p, x); } else { OPB_err(111); } @@ -2191,7 +2198,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__54(19, 30, p, x); + p = NewOp__55(19, 30, p, x); } else { OPB_err(111); } @@ -2237,7 +2244,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) break; } *par0 = p; - StPar1__53_s = _s.lnk; + StPar1__54_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) @@ -2356,7 +2363,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; - if (((fvarpar || sysflag != 0) && ftyp == OPT_bytetyp)) { + if (ftyp == OPT_bytetyp) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { if (__IN(18, OPM_Options, 32)) { OPB_err(-301); @@ -2426,9 +2433,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } else { OPB_CheckLeaf(ap, 0); } - if (ap->readonly) { - OPB_err(76); - } + OPB_CheckWrite(ap); if (fp->typ->comp == 3) { OPB_DynArrParCheck(fp->typ, ap->typ, 1); } else if ((fp->typ->comp == 4 && ap->typ->comp == 4)) { @@ -2540,9 +2545,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_err(56); } OPB_CheckAssign((*x)->typ, y); - if ((*x)->readonly) { - OPB_err(76); - } + OPB_CheckWrite(*x); if ((*x)->typ->comp == 4) { if ((*x)->class == 5) { z = (*x)->left; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8277e38f..a81af7dd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0fdd8d5a..1fe12e58 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -141,7 +141,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) { CHAR ch; INT16 i; - __DUP(s, s__len, CHAR); ch = s[0]; i = 0; while (ch != 0x00) { @@ -153,7 +152,6 @@ static void OPC_Str1 (CHAR *s, ADDRESS s__len, INT32 x) i += 1; ch = s[__X(i, s__len)]; } - __DEL(s); } static INT16 OPC_Length (CHAR *s, ADDRESS s__len) @@ -727,12 +725,10 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, ADDRESS y__len) { INT16 i; - __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - __DEL(y); return y[__X(i, y__len)] == 0x00; } @@ -1466,7 +1462,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((var->typ->comp == 2 && var->mode == 1)) { + if ((((var->written && var->typ->comp == 2)) && var->mode == 1)) { OPC_BegStat(); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); @@ -1482,7 +1478,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && __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); @@ -1632,7 +1628,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } var = proc->link; while (var != NIL) { - if ((((var->typ->comp == 3 && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((((var->written && var->typ->comp == 3)) && var->mode == 1)) && var->typ->sysflag == 0)) { if (indent) { OPC_BegStat(); } else { @@ -1752,7 +1748,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) { INT32 i; INT16 c; - __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { @@ -1773,7 +1768,6 @@ static void OPC_StringLiteral (CHAR *s, ADDRESS s__len, INT32 l) i += 1; } OPM_Write('"'); - __DEL(s); } void OPC_Case (INT64 caseVal, INT16 form) diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 9753be69..dceec267 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index a1f841f0..c61bea4e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -27,7 +27,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -112,9 +112,7 @@ void OPM_LogW (CHAR ch) void OPM_LogWStr (CHAR *s, ADDRESS s__len) { - __DUP(s, s__len, CHAR); Out_String(s, s__len); - __DEL(s); } void OPM_LogWNum (INT64 i, INT64 len) @@ -129,16 +127,13 @@ void OPM_LogWLn (void) void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len) { - __DUP(vt100code, vt100code__len, CHAR); if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { VT100_SetAttr(vt100code, vt100code__len); } - __DEL(vt100code); } void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) { - __DUP(modname, modname__len, CHAR); OPM_LogWStr((CHAR*)"Compiling ", 11); OPM_LogWStr(modname, modname__len); if (__IN(18, OPM_Options, 32)) { @@ -154,7 +149,6 @@ void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len) OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1); } OPM_LogW('.'); - __DEL(modname); } INT64 OPM_SignedMaximum (INT32 bytecount) @@ -183,7 +177,6 @@ INT16 OPM_Integer (INT64 n) static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -263,7 +256,6 @@ static void OPM_ScanOptions (CHAR *s, ADDRESS s__len) } i += 1; } - __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -338,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT.", 95); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -410,21 +402,25 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 4; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; + OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; + OPM_SetSize = 4; break; } __MOVE(OPM_InstallDir, OPM_ResourceDir, 1024); @@ -492,7 +488,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES { INT16 i, j; CHAR ch; - __DUP(ext, ext__len, CHAR); i = 0; for (;;) { ch = name[__X(i, name__len)]; @@ -509,7 +504,6 @@ static void OPM_MakeFileName (CHAR *name, ADDRESS name__len, CHAR *FName, ADDRES i += 1; j += 1; } while (!(ch == 0x00)); - __DEL(ext); } static void OPM_LogErrMsg (INT16 n) @@ -1050,28 +1044,23 @@ static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len) { CHAR testpath[4096]; Platform_FileIdentity identity; - __DUP(s, s__len, CHAR); __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/lib/lib", 9, (void*)testpath, 4096); Strings_Append((CHAR*)"voc", 4, (void*)testpath, 4096); Strings_Append((CHAR*)"-O2.a", 6, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/include/Oberon.h", 20, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } __COPY(OPM_InstallDir, testpath, 4096); Strings_Append((CHAR*)"/2/sym/Files.sym", 17, (void*)testpath, 4096); if (Platform_IdentifyByName(testpath, 4096, &identity, Platform_FileIdentity__typ) != 0) { - __DEL(s); return 0; } - __DEL(s); return 1; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index da46f609..98d27008 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index b4ac155d..2e1431f4 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 73c8598f..73c2a584 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 664a235c..f69e0939 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index cb9bc36e..de90089e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b61a27bd..f9c229ee 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -77,7 +77,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 40dca306..fc2ce0c6 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPT__h #define OPT__h @@ -55,7 +55,7 @@ typedef OPS_Name name; BOOLEAN leaf; INT8 mode, mnolev, vis, history; - BOOLEAN used, fpdone; + BOOLEAN used, fpdone, written; INT32 fprint; OPT_Struct typ; OPT_Const conval; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 6205abba..2256058f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ecd47da2..73d437e0 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 784a60ca..1d926aca 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 49eddd6f..82fbe7a1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a0fbf5f6..9f4e7ed7 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -218,14 +218,11 @@ BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__le { 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); - __DEL(var); return 1; } else { - __DEL(var); return 0; } __RETCHK; @@ -233,11 +230,9 @@ BOOLEAN Platform_getEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__le void Platform_GetEnv (CHAR *var, ADDRESS var__len, CHAR *val, ADDRESS val__len) { - __DUP(var, var__len, CHAR); if (!Platform_getEnv(var, var__len, (void*)val, val__len)) { val[0] = 0x00; } - __DEL(var); } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -287,7 +282,6 @@ void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) { INT16 result; - __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); Platform_processInfo(); @@ -297,7 +291,6 @@ INT16 Platform_System (CHAR *cmd, ADDRESS cmd__len) } Platform_cleanupProcess(); } - __DEL(cmd); return __ASHL(result, 8); } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e0ab21c9..b60a0c35 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2636c568..7e623d5d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 222cb788..c839d865 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 22943103..a2b57ee8 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -42,7 +42,6 @@ INT16 Strings_Length (CHAR *s, ADDRESS s__len) void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__len) { INT16 n1, n2, i; - __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; @@ -53,7 +52,6 @@ void Strings_Append (CHAR *extra, ADDRESS extra__len, CHAR *dest, ADDRESS dest__ if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } - __DEL(extra); } void Strings_Insert (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) @@ -112,16 +110,13 @@ void Strings_Delete (CHAR *s, ADDRESS s__len, INT16 pos, INT16 n) void Strings_Replace (CHAR *source, ADDRESS source__len, INT16 pos, CHAR *dest, ADDRESS dest__len) { - __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); Strings_Insert(source, source__len, pos, (void*)dest, dest__len); - __DEL(source); } void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHAR *dest, ADDRESS dest__len) { INT16 len, destLen, i; - __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); destLen = __SHORT(dest__len, 32768) - 1; if (pos < 0) { @@ -129,7 +124,6 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA } if (pos >= len) { dest[0] = 0x00; - __DEL(source); return; } i = 0; @@ -140,19 +134,14 @@ void Strings_Extract (CHAR *source, ADDRESS source__len, INT16 pos, INT16 n, CHA i += 1; } dest[__X(i, dest__len)] = 0x00; - __DEL(source); } INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, INT16 pos) { INT16 n1, n2, i, j; - __DUP(pattern, pattern__len, CHAR); - __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - __DEL(pattern); - __DEL(s); return 0; } i = pos; @@ -163,15 +152,11 @@ INT16 Strings_Pos (CHAR *pattern, ADDRESS pattern__len, CHAR *s, ADDRESS s__len, j += 1; } if (j == n2) { - __DEL(pattern); - __DEL(s); return i; } } i += 1; } - __DEL(pattern); - __DEL(s); return -1; } @@ -241,7 +226,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) INT16 p, e; REAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -295,7 +279,6 @@ void Strings_StrToReal (CHAR *s, ADDRESS s__len, REAL *r) y = -y; } *r = y; - __DEL(s); } void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) @@ -303,7 +286,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) INT16 p, e; LONGREAL y, g; BOOLEAN neg, negE; - __DUP(s, s__len, CHAR); p = 0; while (s[__X(p, s__len)] == ' ' || s[__X(p, s__len)] == '0') { p += 1; @@ -357,7 +339,6 @@ void Strings_StrToLongReal (CHAR *s, ADDRESS s__len, LONGREAL *r) y = -y; } *r = y; - __DEL(s); } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 7ff642d1..21bf151b 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a961b700..3f10b0fc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -1031,13 +1031,11 @@ void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, ADDRESS s__len) { INT16 i; - __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { Texts_Write(&*W, W__typ, s[__X(i, s__len)]); i += 1; } - __DEL(s); } void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) @@ -1548,7 +1546,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) Texts_Piece p = NIL; CHAR tag, version; INT32 hlen; - __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { f = Files_New((CHAR*)"", 1); @@ -1593,7 +1590,6 @@ void Texts_Open (Texts_Text T, CHAR *name, ADDRESS name__len) T->cache = T->head; T->corg = 0; } - __DEL(name); } static struct Store__39 { @@ -1762,7 +1758,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) Files_Rider r; INT16 i, res; CHAR bak[64]; - __DUP(name, name__len, CHAR); f = Files_New(name, name__len); Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); @@ -1780,7 +1775,6 @@ void Texts_Close (Texts_Text T, CHAR *name, ADDRESS name__len) bak[__X(i + 4, 64)] = 0x00; Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); - __DEL(name); } static void EnumPtrs(void (*P)(void*)) diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index cac141d8..30f22cc0 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 54cdf683..81684069 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -87,44 +87,37 @@ void VT100_IntToStr (INT32 int_, CHAR *str, ADDRESS str__len) static void VT100_EscSeq0 (CHAR *letter, ADDRESS letter__len) { CHAR cmd[9]; - __DUP(letter, letter__len, CHAR); __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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS letter__len) { CHAR nstr[2]; CHAR cmd[7]; - __DUP(letter, letter__len, CHAR); 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, ADDRESS 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); @@ -133,7 +126,6 @@ static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, ADDRESS letter__len) Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); Out_String(cmd, 12); - __DEL(letter); } void VT100_CUU (INT16 n) @@ -239,11 +231,9 @@ void VT100_DECTCEMh (void) void VT100_SetAttr (CHAR *attr, ADDRESS attr__len) { CHAR tmpstr[16]; - __DUP(attr, attr__len, CHAR); __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); - __DEL(attr); } diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 579843b3..04fe2795 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 02e4cc5c..e3988ab0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -31,8 +31,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES { INT16 r, status, exitcode; extTools_CommandString fullcmd; - __DUP(title, title__len, CHAR); - __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { Out_String((CHAR*)" ", 3); Out_String(cmd, cmd__len); @@ -66,8 +64,6 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES Modules_Halt(exitcode); } } - __DEL(title); - __DEL(cmd); } static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) @@ -84,19 +80,16 @@ static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) void extTools_Assemble (CHAR *moduleName, ADDRESS moduleName__len) { extTools_CommandString cmd; - __DUP(moduleName, moduleName__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c", 3, (void*)cmd, 4096); extTools_execute((CHAR*)"C compile: ", 12, cmd, 4096); - __DEL(moduleName); } void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN statically, CHAR *additionalopts, ADDRESS additionalopts__len) { extTools_CommandString cmd; - __DUP(additionalopts, additionalopts__len, CHAR); extTools_InitialiseCompilerCommand((void*)cmd, 4096); Strings_Append(moduleName, moduleName__len, (void*)cmd, 4096); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 4096); @@ -116,7 +109,6 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 4096); } extTools_execute((CHAR*)"C compile and link: ", 21, cmd, 4096); - __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index eec380ca..2a14f64d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.1.0 [2019/11/11]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ +/* voc 2.1.0 [2019/11/22]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod old mode 100644 new mode 100755 index 6148fea2..5855a008 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -66,7 +66,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; - CASE OPM.LongintSize OF + CASE OPM.SetSize OF |4: OPT.settyp := OPT.set32typ ELSE OPT.settyp := OPT.set64typ END; diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 378ea165..e901cea7 100755 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1,5 +1,5 @@ +(* Oberon Portable build parse tree (front end) *) MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) -(* build parse tree *) IMPORT OPT, OPS, OPM, SYSTEM; @@ -34,12 +34,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE node := OPT.NewNode(OPT.Nvar); err(127) END ; node^.obj := obj; node^.typ := obj^.typ; - - (* Array and record value parameters with copy disabled are readonly *) - IF (obj.mode = OPT.Var) & (obj.typ.comp IN {OPT.Array, OPT.DynArr}) & (obj.typ.sysflag # 0) THEN - node.readonly := TRUE; - END; - RETURN node END NewLeaf; @@ -921,6 +915,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) *) END CheckLeaf; + PROCEDURE CheckWrite(x: OPT.Node); + BEGIN + IF x^.readonly THEN err(76) END; + WHILE x.class IN {OPT.Nfield, OPT.Nindex, OPT.Nguard, OPT.Neguard} DO + x := x.left (* Identify underlying named target variable *) + END; + IF (x # NIL) & (x.obj # NIL) THEN x.obj.written := TRUE END; + END CheckWrite; + PROCEDURE StPar0*(VAR par0: OPT.Node; fctno: INTEGER); (* par0: first param of standard proc *) VAR f: INTEGER; typ: OPT.Struct; x: OPT.Node; BEGIN x := par0; f := x^.typ^.form; @@ -939,7 +942,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF NotVar(x) THEN err(112) ELSIF f = OPT.Pointer THEN IF OPM.NEWusingAdr THEN CheckLeaf(x, TRUE) END ; - IF x^.readonly THEN err(76) END ; + CheckWrite(x); f := x^.typ^.BaseTyp^.comp; IF f IN {OPT.Record, OPT.DynArr, OPT.Array} THEN IF f = OPT.DynArr THEN typ := x^.typ^.BaseTyp END ; @@ -1019,13 +1022,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.decfn: (*INC, DEC*) IF NotVar(x) THEN err(112) ELSIF f # OPT.Int THEN err(111) - ELSIF x^.readonly THEN err(76) + ELSE CheckWrite(x) END |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF NotVar(x) THEN err(112) ELSIF x.typ.form # OPT.Set THEN err(111); x^.typ := OPT.settyp - ELSIF x^.readonly THEN err(76) + ELSE CheckWrite(x) END |OPT.lenfn: (*LEN*) IF ~(x^.typ^.comp IN {OPT.DynArr, OPT.Array}) THEN err(131) END @@ -1145,7 +1148,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.copyfn: (*COPY*) IF NotVar(x) THEN err(112) ELSIF (x^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (x^.typ^.BaseTyp^.form = OPT.Char) THEN - IF x^.readonly THEN err(76) END ; + CheckWrite(x); t := x; x := p; p := t; p := NewOp(OPT.Nassign, OPT.copyfn, p, x) ELSE err(111) END ; @@ -1339,9 +1342,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN (* ftyp^.comp = OPT.DynArr *) sysflag := ftyp.sysflag; f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; - IF (fvarpar OR (sysflag # 0)) & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) + IF (* fvarpar & *) (ftyp = OPT.bytetyp) THEN (* ok, but ... *) (* Allow any parameter type, but give warning in verbose mode *) - IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (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.Options THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN @@ -1387,7 +1391,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF NotVar(ap) THEN err(122) ELSE CheckLeaf(ap, FALSE) END ; - IF ap^.readonly THEN err(76) END ; + CheckWrite(ap); IF fp^.typ^.comp = OPT.DynArr THEN DynArrParCheck(fp^.typ, ap^.typ, TRUE) ELSIF (fp^.typ^.comp = OPT.Record) & (ap^.typ^.comp = OPT.Record) THEN q := ap^.typ; @@ -1460,7 +1464,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN IF x^.class >= OPT.Nconst THEN err(56) END ; CheckAssign(x^.typ, y); - IF x^.readonly THEN err(76) END ; + CheckWrite(x); IF x^.typ^.comp = OPT.Record THEN IF x^.class = OPT.Nguard THEN z := x^.left ELSE z := x END ; IF (z^.class = OPT.Nderef) & (z^.left^.class = OPT.Nguard) THEN diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod old mode 100644 new mode 100755 index d1f9027a..2b4ad3f1 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -973,7 +973,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) 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 + IF var.written + & (var^.typ^.comp = OPT.Array) + & (var^.mode = OPT.Var) THEN BegStat; IF var^.typ^.strobj = NIL THEN OPM.Mark(200, var^.typ^.txtpos) ELSE Ident(var^.typ^.strobj) END ; OPM.Write(' '); Ident(var); OPM.WriteString("__copy"); @@ -983,7 +985,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) 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 + IF var.written + & (var.typ.comp IN {OPT.Array, OPT.DynArr}) + & (var.mode = OPT.Var) + & (var.typ.sysflag = 0) THEN BegStat; IF var^.typ^.comp = OPT.Array THEN OPM.WriteString("__DUPARR("); @@ -1074,7 +1079,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* delete array value parameters *) var := proc^.link; WHILE var # NIL DO - IF (var^.typ^.comp = OPT.DynArr) & (var^.mode = OPT.Var) & (var^.typ^.sysflag = 0) THEN + IF var.written + & (var^.typ^.comp = OPT.DynArr) + & (var^.mode = OPT.Var) + & (var^.typ^.sysflag = 0) THEN IF indent THEN BegStat ELSE indent := TRUE END ; OPM.WriteString('__DEL('); Ident(var); OPM.Write(')'); EndStat END ; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod old mode 100644 new mode 100755 index 85392b15..b64e1e94 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -92,7 +92,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; - ShortintSize*, IntegerSize*, LongintSize*: INTEGER; + ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -273,7 +273,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWLn; LogWStr(" Size model for elementary types (default O2)"); LogWLn; LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; - LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER and SET, 64 bit LONGINT."); LogWLn; LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWLn; LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; @@ -328,10 +328,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxIndex := SignedMaximum(AddressSize); CASE Model[0] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4 - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8 - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8 - ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4 + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4; + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 4; + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8; + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4; END; (*IF verbose IN Options THEN VerboseListSizes END;*) diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index c723b9f5..96117cad 100755 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -1,3 +1,4 @@ +(* OPP - Oberon Portable Parser (front end) *) MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT @@ -893,317 +894,6 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END StatSeq; - (* Debug ---------------------------------------------------------- *) - - PROCEDURE ls(s: ARRAY OF CHAR); BEGIN OPM.LogWStr(s) END ls; - PROCEDURE lc(c: CHAR); BEGIN OPM.LogW(c) END lc; - PROCEDURE li(i: SYSTEM.INT64); BEGIN OPM.LogWNum(i,1) END li; - PROCEDURE ll; BEGIN OPM.LogWLn END ll; - - PROCEDURE lAssert(truth: BOOLEAN; msg: ARRAY OF CHAR); - BEGIN IF ~truth THEN ll; ls(msg); ll; HALT(99) END - END lAssert; - - PROCEDURE lLabel(indent: INTEGER; string: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN FOR i := 1 TO indent DO OPM.LogW(" ") END ; - ls(string); - END lLabel; - - PROCEDURE lForm(form: SHORTINT); - BEGIN - CASE form OF - | 0: ls("Undef") - | 1: ls("Byte") - | 2: ls("Bool") - | 3: ls("Char") - | 4: ls("int") - | 5: ls("Real") - | 6: ls("LReal") - | 7: ls("Set") - | 8: ls("String") - | 9: ls("NilTyp") - | 10: ls("NoTyp") - | 11: ls("Pointer") - | 12: ls("ProcTyp") - | 13: ls("Comp") - | ELSE li(form) - END ; - END lForm; - - PROCEDURE lComp(comp: SHORTINT); - BEGIN - CASE comp OF - | 1: ls("Basic") - | 2: ls("Array") - | 3: ls("DynArr") - | 4: ls("Record") - | ELSE li(comp) - END ; - END lComp; - - PROCEDURE lMode(mode: SHORTINT); - BEGIN - CASE mode OF - | 1: ls("Var") - | 2: ls("VarPar") - | 3: ls("Con") - | 4: ls("Fld") - | 5: ls("Typ") - | 6: ls("LProc") - | 7: ls("XProc") - | 8: ls("SProc") - | 9: ls("CProc") - | 10: ls("IProc") - | 11: ls("Mod") - | 12: ls("Head") - | 13: ls("TProc") - | ELSE li(mode) - END ; - END lMode; - - PROCEDURE ^lStruct(indent: INTEGER; struct: OPT.Struct; skipobj: OPT.Object); - - PROCEDURE IsNamedObject(obj, tree: OPT.Object): BOOLEAN; - VAR result: BOOLEAN; - BEGIN - IF tree = NIL THEN result := FALSE - ELSIF tree = obj THEN result := TRUE - ELSIF IsNamedObject(obj, tree.left) THEN result := TRUE - ELSE - result := IsNamedObject(obj, tree.right) - END; - RETURN result & (obj.name[0] # 0X) - END IsNamedObject; - - PROCEDURE lObject(indent: INTEGER; obj, skipobj: OPT.Object); - VAR global: OPT.Object; - BEGIN - IF (IsNamedObject(obj, OPT.universe) OR IsNamedObject(obj, OPT.syslink)) THEN - ls(obj.name); ll - ELSIF obj = NIL THEN ls("NIL"); ll - ELSIF obj = skipobj THEN ls("skipping: points back to parent."); ll - ELSE - lMode(obj.mode); ls(", '"); ls(obj.name); - IF (obj.typ # NIL) & (obj.typ # OPT.undftyp) & (obj.typ # OPT.notyp) THEN - ls("', typ: "); lStruct(indent+2, obj.typ, obj) - ELSE lc("'"); ll - END; - END - END lObject; - - PROCEDURE lStruct(indent: INTEGER; struct: OPT.Struct; skipobj: OPT.Object); - BEGIN - IF struct = NIL THEN ls("NIL"); ll - ELSIF struct = OPT.undftyp THEN ls(""); ll - ELSIF struct = OPT.notyp THEN ls(""); ll - ELSIF struct = OPT.stringtyp THEN ls(""); ll - ELSIF struct = OPT.niltyp THEN ls(""); ll - ELSIF struct = OPT.bytetyp THEN ls(""); ll - ELSIF struct = OPT.sysptrtyp THEN ls(""); ll - ELSIF struct = OPT.adrtyp THEN ls("
"); ll - ELSIF struct = OPT.int8typ THEN ls(""); ll - ELSIF struct = OPT.int16typ THEN ls(""); ll - ELSIF struct = OPT.int32typ THEN ls(""); ll - ELSIF struct = OPT.int64typ THEN ls(""); ll - ELSIF struct = OPT.set32typ THEN ls(""); ll - ELSIF struct = OPT.set64typ THEN ls(""); ll - ELSIF struct = OPT.booltyp THEN ls(""); ll - ELSIF struct = OPT.chartyp THEN ls(""); ll - ELSIF struct = OPT.realtyp THEN ls(""); ll - ELSIF struct = OPT.lrltyp THEN ls(""); ll - ELSIF struct = OPT.hinttyp THEN ls(""); ll - ELSIF struct = OPT.cpbytetyp THEN ls(""); ll - ELSE - ls("form "); lForm(struct.form); - ls(", comp "); lComp(struct.comp); - ls(", size "); li(struct.size); - ls(", sysflag "); li(struct.sysflag); - IF (struct.strobj = NIL) OR (struct.strobj = skipobj) THEN ll ELSE - ls(", strobj "); lObject(indent+2, struct.strobj, skipobj); - END; - INC(indent, 2); - IF (struct.link # NIL) & (struct.link # skipobj) THEN - lLabel(indent, "struct.link: "); lObject(indent+2, struct.link, skipobj); - END; - IF (struct.BaseTyp # NIL) & (struct.BaseTyp.form # OPT.Undef) & (indent < 40) THEN - lLabel(indent, "struct.BaseTyp: "); lStruct(indent+2, struct.BaseTyp, skipobj) - END - END - END lStruct; - - PROCEDURE lClass(class: SHORTINT); - BEGIN - CASE class OF - | OPT.Nvar: ls("Nvar") - | OPT.Nvarpar: ls("Nvarpar") - | OPT.Nfield: ls("Nfield") - | OPT.Nderef: ls("Nderef") - | OPT.Nindex: ls("Nindex") - | OPT.Nguard: ls("Nguard") - | OPT.Neguard: ls("Neguard") - | OPT.Nconst: ls("Nconst") - | OPT.Ntype: ls("Ntype") - | OPT.Nproc: ls("Nproc") - | OPT.Nupto: ls("Nupto") - | OPT.Nmop: ls("Nmop") - | OPT.Ndop: ls("Ndop") - | OPT.Ncall: ls("Ncall") - | OPT.Ninittd: ls("Ninittd") - | OPT.Nif: ls("Nif") - | OPT.Ncaselse: ls("Ncaselse") - | OPT.Ncasedo: ls("Ncasedo") - | OPT.Nenter: ls("Nenter") - | OPT.Nassign: ls("Nassign") - | OPT.Nifelse: ls("Nifelse") - | OPT.Ncase: ls("Ncase") - | OPT.Nwhile: ls("Nwhile") - | OPT.Nrepeat: ls("Nrepeat") - | OPT.Nloop: ls("Nloop") - | OPT.Nexit: ls("Nexit") - | OPT.Nreturn: ls("Nreturn") - | OPT.Nwith: ls("Nwith") - | OPT.Ntrap: ls("Ntrap") - | ELSE li(class) - END ; - END lClass; - - PROCEDURE lSubclass(subclass: SHORTINT); - BEGIN - CASE subclass OF - | OPT.assign: ls("assign") - | OPT.super: ls("super") - | OPT.eql: ls("sym-eql") - | OPT.neq: ls("sym-neq") - | OPT.lss: ls("sym-lss") - | OPT.leq: ls("sym-leq") - | OPT.gtr: ls("sym-gtr") - | OPT.geq: ls("sym-geq") - | OPT.ash: ls("fn-ash") - | OPT.msk: ls("fn-msk") - | OPT.len: ls("fn-len") - | OPT.conv: ls("fn-conv") - | OPT.abs: ls("fn-abs") - | OPT.cap: ls("fn-cap") - | OPT.odd: ls("fn-odd") - | OPT.adr: ls("sys-adr") - | OPT.cc: ls("sys-cc") - | OPT.bit: ls("sys-bit") - | OPT.lsh: ls("sys-lsh") - | OPT.rot: ls("sys-rot") - | OPT.val: ls("sys-val") - | ELSE li(subclass) - END ; - END lSubclass; - - PROCEDURE lBoolean(b: BOOLEAN); - BEGIN IF b THEN ls("true") ELSE ls("false") END END lBoolean; - - PROCEDURE lSet(s: SYSTEM.SET64); - VAR i: INTEGER; - BEGIN - lc("{"); - FOR i := 0 TO 63 DO - IF i IN s THEN li(i); EXCL(s, i) END - END; - IF s # {} THEN lc(",") END; - lc("}"); - END lSet; - - PROCEDURE lConstValue(indent: INTEGER; c: OPT.Const); - BEGIN - IF c = NIL THEN ls("NIL") ELSE - ls("("); - IF c.ext #NIL THEN ls("'"); ls(c.ext^); ls("', ") END; - li(c.intval); ls(","); - li(c.intval2); ls(",");; - lSet(c.setval); ls(")");; - (*lLabel(indent, "realval: ); lReal(c.realVal); ll; *) - END; - END lConstValue; - - PROCEDURE lNodeDetail(indent: INTEGER; node: OPT.Node); - BEGIN - IF node = NIL THEN ls("NIL"); ll ELSE - lClass(node.class); - IF node.subcl # 0 THEN lc(" "); lSubclass(node.subcl) END; - IF node.readonly THEN ls(", r/o") ELSE ls(", r/w") END; - IF node.conval # NIL THEN ls(", "); lConstValue(indent, node.conval) END; - IF node.obj # NIL THEN ls(", obj: "); lObject(indent, node.obj, NIL) - ELSE ll END; - INC(indent,2); - IF (node.typ # NIL) & (node.typ # OPT.notyp) THEN lLabel(indent, "node.typ: "); lStruct(indent, node.typ, NIL) END; - IF node.link # NIL THEN lLabel(indent, "node.link: "); lNodeDetail(indent, node.link) END; - END; - END lNodeDetail; - - PROCEDURE lNodeTree(indent: INTEGER; node: OPT.Node); - BEGIN - lNodeDetail(indent, node); - IF node.left # NIL THEN lLabel(indent, "Left:"); ll; lLabel(indent+2, ""); lNodeTree(indent+2, node.left) END; - IF node.right # NIL THEN lLabel(indent, "Right:"); ll; lLabel(indent+2, ""); lNodeTree(indent+2, node.right) END; - END lNodeTree; - - PROCEDURE lProcHeader(indent: INTEGER; VAR obj: OPT.Object); - VAR parms: OPT.Object; - BEGIN - lAssert((obj # NIL) & (obj.mode = OPT.LProc), "lProcHeader expected obj.mode = LProc"); - lLabel(indent, "PROCEDURE "); ls(obj.name); - parms := obj.link; - IF (obj.typ # OPT.notyp) OR ((parms # NIL) & (parms.mode # OPT.LProc)) THEN - ls("("); - WHILE (parms # NIL) & (parms.mode # OPT.LProc) DO - lMode(parms.mode); ls(" "); ls(parms.name); ls(": "); - IF parms.typ = NIL THEN ls("*NIL*") ELSE lForm(parms.typ.form) END; - parms := parms.link; - IF (parms # NIL) & (parms.mode # OPT.LProc) THEN ls("; ") END; - END; - ls(")"); - IF obj.typ # OPT.notyp THEN ls(": "); lStruct(indent+2, obj.typ, obj) ELSE ll END; - END; - obj := parms - END lProcHeader; - - PROCEDURE lBlock(indent: INTEGER; nenter: OPT.Node); - VAR obj: OPT.Object; defs: OPT.Node; - BEGIN obj := nenter.obj; - IF obj = NIL THEN lLabel(indent, "MODULE"); ll; - ELSE WHILE obj # NIL DO lProcHeader(indent, obj) END; - END; - defs := nenter.left; - WHILE defs # NIL DO - IF (defs.obj # NIL) & (defs.obj.mode = OPT.LProc) THEN - lBlock(indent+2, defs) - ELSE - ls("*UNEXPECTED* "); lNodeDetail(indent, defs) - END; - defs := defs.link; - END; - END lBlock; - - (* ---------------------------------------------------------------- *) - - PROCEDURE lObjectTree(obj: OPT.Object); - BEGIN - IF obj.left # NIL THEN lObjectTree(obj.left) END; - lObject(2, obj, NIL); - IF obj.right # NIL THEN lObjectTree(obj.right) END; - END lObjectTree; - - PROCEDURE OptimizeUnmodifiableStructuredValueParameters(procdec, statseq: OPT.Node); - (* Scan and report content of procdec and statseq with a view to detecting - writes to value array/record parameters *) - (* TODO This should run just once after the OPP.Block call in OPP.Module *) - VAR obj: OPT.Object; - BEGIN - IF OPM.verbose IN OPM.Options THEN - ll; ls("procdec: "); ll; lNodeTree(0, procdec); - ll; ls("procdec as block:"); ll; lBlock(0, procdec); - ll; - END; - END OptimizeUnmodifiableStructuredValueParameters; - - PROCEDURE Block(VAR procdec, statseq: OPT.Node); VAR typ: OPT.Struct; obj, first, last: OPT.Object; @@ -1338,9 +1028,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) CheckSym(OPS.semicolon) END ; IF OPM.noerr THEN TDinit := NIL; lastTDinit := NIL; c := OPM.errpos; - Block(procdec, statseq); OPB.Enter(procdec, statseq, NIL); - OptimizeUnmodifiableStructuredValueParameters(procdec, statseq); - prog := procdec; + Block(procdec, statseq); OPB.Enter(procdec, statseq, NIL); prog := procdec; prog^.conval := OPT.NewConst(); prog^.conval^.intval := c; IF sym = OPS.ident THEN IF OPS.name # OPT.SelfName THEN err(4) END ; diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod old mode 100644 new mode 100755 index 909cdee2..9cb59e37 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -1,3 +1,4 @@ +(* Oberon Portable Scanner (front end) *) MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) IMPORT OPM, SYSTEM; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index bfada949..8b6b8dd7 100755 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1,3 +1,4 @@ +(* OPT - Oberon Portable Symbol Table (front end) *) MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) (* @@ -41,6 +42,7 @@ TYPE vis*: SHORTINT; (* internal, external, externalR *) history*: SHORTINT; (* relevant if name # "" *) used*, fpdone*: BOOLEAN; + written*: BOOLEAN; (* determines whether to copy value array parameters *) fprint*: LONGINT; typ*: Struct; conval*: Const; @@ -200,7 +202,7 @@ TYPE END; VAR - universe*, syslink*: Object; + universe, syslink: Object; impCtxt: ImpCtxt; expCtxt: ExpCtxt; nofhdfld: LONGINT; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod old mode 100644 new mode 100755 index 371d69d3..c6b26c05 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -1,3 +1,4 @@ +(* OPV - parse tree traverser (back end) *) MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 26.7.2002 jt bug fix OPS.in Len: wrong result if called for fixed OPT.Array diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt old mode 100644 new mode 100755 diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index b12e60bb..bae6e1d3 100755 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -461,7 +461,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files r.offset := offset + 1; r.res := 0 END Write; - PROCEDURE WriteBytes* (VAR r: Rider; x: ARRAY [1] OF SYSTEM.BYTE; n: LONGINT); + PROCEDURE WriteBytes* (VAR r: Rider; x: ARRAY OF SYSTEM.BYTE; n: LONGINT); VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; BEGIN IF n > LEN(x) THEN IdxTrap END; @@ -670,13 +670,6 @@ Especially Length would become fairly complex. x[i] := 0X END ReadLine; - (* old readline code: - 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. * ) - *) - 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/runtime/Strings.Mod b/src/runtime/Strings.Mod index 6b9352f9..c9197e06 100755 --- a/src/runtime/Strings.Mod +++ b/src/runtime/Strings.Mod @@ -29,9 +29,9 @@ Strings.Cap(s) -------------------------------------------------------------*) (* added from trianus v4 *) MODULE Strings; (*HM 94-06-22 / *) (* noch 2017-06-21 *) -IMPORT Reals, SYSTEM; +IMPORT Reals; -PROCEDURE Length* (s: ARRAY [1] OF CHAR): INTEGER; +PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; VAR i: LONGINT; BEGIN i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END;