diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 72e13291..d30cb712 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -478,11 +478,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END DefineType; PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; r: BOOLEAN; + VAR i: INTEGER; BEGIN i := 0; - WHILE x[i+1] = y[i] DO INC(i) END ; - r := y[i] = 0X; - RETURN r; + WHILE x[i+1] = y[i] DO INC(i) END; + RETURN y[i] = 0X; END Prefixed; PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); @@ -957,15 +956,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ; ProcHeader(proc, TRUE); BegBlk; - - (* If there will be a result, provide a result variable. *) - IF proc^.typ # OPT.notyp THEN - BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; - scope := proc^.scope; IdentList(scope^.scope, 0); IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 68215490..e17c4614 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -236,14 +236,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF Platform.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; - LogWStr("Based on Ofront by Software Templ OEG."); LogWLn; + LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn; LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; LogWLn; LogWStr("Usage:"); LogWLn; LogWLn; LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn; LogWLn; - LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWStr('Options:'); LogWLn; LogWLn; LogWStr(" Run time safety"); LogWLn; LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dd089baf..83c451c3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -876,19 +876,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.Nreturn: IF OPM.level = 0 THEN IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE + OPC.ExitProc(outerProc, FALSE, FALSE); + OPM.WriteString("return"); IF n^.left # NIL THEN - (* Make local copy of result before ExitProc deletes dynamic vars *) - OPM.WriteString("_o_result = "); + OPM.Write(Blank); IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN OPM.WriteString("(void*)"); expr(n^.left, 10) ELSE expr(n^.left, MinPrec) - END; - OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; - OPC.ExitProc(outerProc, FALSE, FALSE); - OPM.WriteString("return _o_result"); - ELSE - OPM.WriteString("return"); + END END END | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 165b5ec8..cb7c8815 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) - -//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -//#define __DEL(x) Platform_OSFree((address)x) - #define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) #define __DEL(x) @@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) - #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x