Update bootstrap and fix source change tests. Typo in command ine help.

This commit is contained in:
David Brown 2016-10-28 20:06:30 +01:00
parent 126ef6d479
commit 6a4748e2af
78 changed files with 1026 additions and 2564 deletions

View file

@ -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; \ #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;} 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 __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 __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t))
#define __DEL(x) #define __DEL(x)
@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
#define __VAL(t, x) (*(t*)&(x)) #define __VAL(t, x) (*(t*)&(x))
#define __GET(a, x, t) x=*(t*)(address)(a) #define __GET(a, x, t) x=*(t*)(address)(a)
#define __PUT(a, x, t) *(t*)(address)(a)=x #define __PUT(a, x, t) *(t*)(address)(a)=x

View file

@ -317,14 +317,11 @@ void Files_Close (Files_File f)
int32 Files_Length (Files_File f) int32 Files_Length (Files_File f)
{ {
int32 _o_result; return f->len;
_o_result = f->len;
return _o_result;
} }
Files_File Files_New (CHAR *name, LONGINT name__len) Files_File Files_New (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
f->len = 0; f->len = 0;
f->pos = 0; f->pos = 0;
f->swapper = -1; f->swapper = -1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
CHAR ch; CHAR ch;
i = 0; i = 0;
@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
i += 1; i += 1;
ch = name[i]; ch = name[i];
} }
_o_result = ch == '/'; return ch == '/';
return _o_result;
} }
static Files_File Files_CacheEntry (Platform_FileIdentity identity) static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int16 i, error; int16 i, error;
f = Files_files; f = Files_files;
@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
f->identity = identity; f->identity = identity;
error = Platform_Size(f->fd, &f->len); error = Platform_Size(f->fd, &f->len);
} }
_o_result = f; return f;
return _o_result;
} }
f = f->next; f = f->next;
} }
_o_result = NIL; return NIL;
return _o_result;
} }
Files_File Files_Old (CHAR *name, LONGINT name__len) Files_File Files_Old (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int32 fd; int32 fd;
int16 pos; int16 pos;
@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
f = Files_CacheEntry(identity); f = Files_CacheEntry(identity);
if (f != NIL) { if (f != NIL) {
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} else { } else {
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
Heap_RegisterFinalizer((void*)f, Files_Finalize); Heap_RegisterFinalizer((void*)f, Files_Finalize);
@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->next = Files_files; f->next = Files_files;
Files_files = f; Files_files = f;
Heap_FileCount += 1; Heap_FileCount += 1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
} else if (dir[0] == 0x00) { } else if (dir[0] == 0x00) {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} else { } else {
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256); Files_ScanPath(&pos, (void*)dir, 256);
} }
} }
} else { } else {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }
@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d)
int32 Files_Pos (Files_Rider *r, address *r__typ) int32 Files_Pos (Files_Rider *r, address *r__typ)
{ {
int32 _o_result; return (*r).org + (*r).offset;
_o_result = (*r).org + (*r).offset;
return _o_result;
} }
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
Files_File Files_Base (Files_Rider *r, address *r__typ) Files_File Files_Base (Files_Rider *r, address *r__typ)
{ {
Files_File _o_result; return (*r).buf->f;
_o_result = (*r).buf->f;
return _o_result;
} }
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
error = Platform_Rename((void*)old, old__len, (void*)new, new__len); error = Platform_Rename((void*)old, old__len, (void*)new, new__len);
if (!Platform_DifferentFilesystems(error)) { if (!Platform_DifferentFilesystems(error)) {
*res = error; *res = error;
__DEL(old);
__DEL(new);
return; return;
} else { } else {
error = Platform_OldRO((void*)old, old__len, &fdold); error = Platform_OldRO((void*)old, old__len, &fdold);
if (error != 0) { if (error != 0) {
*res = 2; *res = 2;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_New((void*)new, new__len, &fdnew); error = Platform_New((void*)new, new__len, &fdnew);
if (error != 0) { if (error != 0) {
error = Platform_Close(fdold); error = Platform_Close(fdold);
*res = 3; *res = 3;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_Read(fdold, (address)buf, 4096, &n); error = Platform_Read(fdold, (address)buf, 4096, &n);

View file

@ -127,7 +127,6 @@ void Heap_Unlock (void)
SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
{ {
SYSTEM_PTR _o_result;
Heap_Module m; Heap_Module m;
if (__STRCMP(name, "Heap") == 0) { if (__STRCMP(name, "Heap") == 0) {
__SYSNEW(m, 48); __SYSNEW(m, 48);
@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
m->enumPtrs = enumPtrs; m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(address)Heap_modules; m->next = (Heap_Module)(address)Heap_modules;
Heap_modules = (SYSTEM_PTR)m; Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m; return (void*)m;
return _o_result;
} }
void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m)
static int32 Heap_NewChunk (int32 blksz) static int32 Heap_NewChunk (int32 blksz)
{ {
int32 _o_result;
int32 chnk; int32 chnk;
chnk = Heap_OSAllocate(blksz + 12); chnk = Heap_OSAllocate(blksz + 12);
if (chnk != 0) { if (chnk != 0) {
@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz)
Heap_bigBlocks = chnk + 12; Heap_bigBlocks = chnk + 12;
Heap_heapsize += blksz; Heap_heapsize += blksz;
} }
_o_result = chnk; return chnk;
return _o_result;
} }
static void Heap_ExtendHeap (int32 blksz) static void Heap_ExtendHeap (int32 blksz)
@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz)
SYSTEM_PTR Heap_NEWREC (int32 tag) SYSTEM_PTR Heap_NEWREC (int32 tag)
{ {
SYSTEM_PTR _o_result;
int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
new = Heap_NEWREC(tag); new = Heap_NEWREC(tag);
} }
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} else { } else {
Heap_Unlock(); Heap_Unlock();
_o_result = NIL; return NIL;
return _o_result;
} }
} }
__GET(adr + 4, t, int32); __GET(adr + 4, t, int32);
@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
__PUT(adr + 8, 0, int32); __PUT(adr + 8, 0, int32);
Heap_allocated += blksz; Heap_allocated += blksz;
Heap_Unlock(); Heap_Unlock();
_o_result = (SYSTEM_PTR)(address)(adr + 4); return (SYSTEM_PTR)(address)(adr + 4);
return _o_result;
} }
SYSTEM_PTR Heap_NEWBLK (int32 size) SYSTEM_PTR Heap_NEWBLK (int32 size)
{ {
SYSTEM_PTR _o_result;
int32 blksz, tag; int32 blksz, tag;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size)
__PUT(tag + 4, -4, int32); __PUT(tag + 4, -4, int32);
__PUT((int32)(address)new - 4, tag, int32); __PUT((int32)(address)new - 4, tag, int32);
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} }
static void Heap_Mark (int32 q) static void Heap_Mark (int32 q)

View file

@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
{ {
Modules_Module _o_result;
Modules_Module m = NIL; Modules_Module m = NIL;
CHAR bodyname[64]; CHAR bodyname[64];
Modules_Command body; Modules_Command body;
@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
} }
_o_result = m;
__DEL(name); __DEL(name);
return _o_result; return m;
} }
Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len)
{ {
Modules_Command _o_result;
Modules_Cmd c = NIL; Modules_Cmd c = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
c = mod->cmds; c = mod->cmds;
@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
if (c != NIL) { if (c != NIL) {
Modules_res = 0; Modules_res = 0;
Modules_resMsg[0] = 0x00; Modules_resMsg[0] = 0x00;
_o_result = c->cmd;
__DEL(name); __DEL(name);
return _o_result; return c->cmd;
} else { } else {
Modules_res = 2; Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11); __MOVE(" command \"", Modules_resMsg, 11);
@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }

View file

@ -74,7 +74,6 @@ static void OPB_err (int16 n)
OPT_Node OPB_NewLeaf (OPT_Object obj) OPT_Node OPB_NewLeaf (OPT_Object obj)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
switch (obj->mode) { switch (obj->mode) {
case 1: case 1:
@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
} }
node->obj = obj; node->obj = obj;
node->typ = obj->typ; node->typ = obj->typ;
_o_result = node; return node;
return _o_result;
} }
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
static int16 OPB_BoolToInt (BOOLEAN b) static int16 OPB_BoolToInt (BOOLEAN b)
{ {
int16 _o_result;
if (b) { if (b) {
_o_result = 1; return 1;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
static BOOLEAN OPB_IntToBool (int64 i) static BOOLEAN OPB_IntToBool (int64 i)
{ {
BOOLEAN _o_result; return i != 0;
_o_result = i != 0;
return _o_result;
} }
OPT_Node OPB_NewBoolConst (BOOLEAN boolval) OPT_Node OPB_NewBoolConst (BOOLEAN boolval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_booltyp; x->typ = OPT_booltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = OPB_BoolToInt(boolval); x->conval->intval = OPB_BoolToInt(boolval);
_o_result = x; return x;
return _o_result;
} }
void OPB_OptIf (OPT_Node *x) void OPB_OptIf (OPT_Node *x)
@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x)
OPT_Node OPB_Nil (void) OPT_Node OPB_Nil (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_niltyp; x->typ = OPT_niltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = 0; x->conval->intval = 0;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_EmptySet (void) OPT_Node OPB_EmptySet (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_settyp; x->typ = OPT_settyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->setval = 0x0; x->conval->setval = 0x0;
_o_result = x; return x;
return _o_result;
} }
static void OPB_SetIntType (OPT_Node node) static void OPB_SetIntType (OPT_Node node)
@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node)
OPT_Node OPB_NewIntConst (int64 intval) OPT_Node OPB_NewIntConst (int64 intval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = intval; x->conval->intval = intval;
OPB_SetIntType(x); OPB_SetIntType(x);
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->realval = realval; x->conval->realval = realval;
x->typ = typ; x->typ = typ;
x->conval->intval = -1; x->conval->intval = -1;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewString (OPS_String str, int64 len) OPT_Node OPB_NewString (OPS_String str, int64 len)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len)
x->conval->intval2 = OPM_Longint(len); x->conval->intval2 = OPM_Longint(len);
x->conval->ext = OPT_NewExt(); x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, 256); __COPY(str, *x->conval->ext, 256);
_o_result = x; return x;
return _o_result;
} }
static void OPB_CharToString (OPT_Node n) static void OPB_CharToString (OPT_Node n)
@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN OPB_NotVar (OPT_Node x) static BOOLEAN OPB_NotVar (OPT_Node x)
{ {
BOOLEAN _o_result; return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
_o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
return _o_result;
} }
void OPB_DeRef (OPT_Node *x) void OPB_DeRef (OPT_Node *x)
@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y)
static int64 OPB_log (int64 x) static int64 OPB_log (int64 x)
{ {
int64 _o_result;
OPB_exp = 0; OPB_exp = 0;
if (x > 0) { if (x > 0) {
while (!__ODD(x)) { while (!__ODD(x)) {
@ -497,8 +475,7 @@ static int64 OPB_log (int64 x)
OPB_exp += 1; OPB_exp += 1;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(11); node = OPT_NewNode(11);
node->subcl = op; node->subcl = op;
node->typ = typ; node->typ = typ;
node->left = z; node->left = z;
_o_result = node; return node;
return _o_result;
} }
void OPB_MOp (int8 op, OPT_Node *x) void OPB_MOp (int8 op, OPT_Node *x)
@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void) static int16 ConstCmp__14 (void)
{ {
int16 _o_result;
int16 res; int16 res;
switch (*ConstOp__13_s->f) { switch (*ConstOp__13_s->f) {
case 0: case 0:
@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void)
break; break;
} }
(*ConstOp__13_s->x)->typ = OPT_booltyp; (*ConstOp__13_s->x)->typ = OPT_booltyp;
_o_result = res; return res;
return _o_result;
} }
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
{ {
BOOLEAN _o_result;
BOOLEAN ok, xCharArr, yCharArr; BOOLEAN ok, xCharArr, yCharArr;
xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8;
yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8;
@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
OPB_Index(&*x, OPB_NewIntConst(0)); OPB_Index(&*x, OPB_NewIntConst(0));
} }
} }
_o_result = ok; return ok;
return _o_result;
} }
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(class); node = OPT_NewNode(class);
node->subcl = subcl; node->subcl = subcl;
node->left = left; node->left = left;
node->right = right; node->right = right;
_o_result = node; return node;
return _o_result;
} }
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)

View file

@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static int16 OPC_Length (CHAR *s, LONGINT s__len) static int16 OPC_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
i = 0; i = 0;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
i += 1; i += 1;
} }
_o_result = i; return i;
return _o_result;
} }
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i, h; int16 i, h;
i = 0; i = 0;
h = 0; h = 0;
@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
h = 3 * h + (int16)s[__X(i, s__len)]; h = 3 * h + (int16)s[__X(i, s__len)];
i += 1; i += 1;
} }
_o_result = (int)__MOD(h, 105); return (int)__MOD(h, 105);
return _o_result;
} }
void OPC_Ident (OPT_Object obj) void OPC_Ident (OPT_Object obj)
@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
_o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result;
} }
static void OPC_DeclareBase (OPT_Object dcl) static void OPC_DeclareBase (OPT_Object dcl)
@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
int32 OPC_NofPtrs (OPT_Struct typ) int32 OPC_NofPtrs (OPT_Struct typ)
{ {
int32 _o_result;
OPT_Object fld = NIL; OPT_Object fld = NIL;
OPT_Struct btyp = NIL; OPT_Struct btyp = NIL;
int32 n; int32 n;
if ((typ->form == 11 && typ->sysflag == 0)) { if ((typ->form == 11 && typ->sysflag == 0)) {
_o_result = 1; return 1;
return _o_result;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp != NIL) { if (btyp != NIL) {
@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ)
} }
fld = fld->link; fld = fld->link;
} }
_o_result = n; return n;
return _o_result;
} else if (typ->comp == 2) { } else if (typ->comp == 2) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
n = typ->n; n = typ->n;
@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ)
n = btyp->n * n; n = btyp->n * n;
btyp = btyp->BaseTyp; btyp = btyp->BaseTyp;
} }
_o_result = OPC_NofPtrs(btyp) * n; return OPC_NofPtrs(btyp) * n;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Object OPC_BaseTProc (OPT_Object obj)
{ {
OPT_Object _o_result;
OPT_Struct typ = NIL, base = NIL; OPT_Struct typ = NIL, base = NIL;
int32 mno; int32 mno;
typ = obj->link->typ; typ = obj->link->typ;
@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj)
base = typ->BaseTyp; base = typ->BaseTyp;
} }
OPT_FindField(obj->name, typ, &obj); OPT_FindField(obj->name, typ, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
BOOLEAN r;
__DUP(y, y__len, CHAR); __DUP(y, y__len, CHAR);
i = 0; i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
i += 1; i += 1;
} }
r = y[__X(i, y__len)] == 0x00;
_o_result = r;
__DEL(y); __DEL(y);
return _o_result; return y[__X(i, y__len)] == 0x00;
} }
static void OPC_CProcDefs (OPT_Object obj, int16 vis) static void OPC_CProcDefs (OPT_Object obj, int16 vis)
@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc)
} }
OPC_ProcHeader(proc, 1); OPC_ProcHeader(proc, 1);
OPC_BegBlk(); OPC_BegBlk();
if (proc->typ != OPT_notyp) {
OPC_BegStat();
OPC_Ident(proc->typ->strobj);
OPM_WriteString((CHAR*)" _o_result;", 12);
OPM_WriteLn();
}
scope = proc->scope; scope = proc->scope;
OPC_IdentList(scope->scope, 0); OPC_IdentList(scope->scope, 0);
if (!scope->leaf) { if (!scope->leaf) {

View file

@ -124,33 +124,25 @@ void OPM_LogWLn (void)
int64 OPM_SignedMaximum (int32 bytecount) int64 OPM_SignedMaximum (int32 bytecount)
{ {
int64 _o_result;
int64 result; int64 result;
result = 1; result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
_o_result = result - 1; return result - 1;
return _o_result;
} }
int64 OPM_SignedMinimum (int32 bytecount) int64 OPM_SignedMinimum (int32 bytecount)
{ {
int64 _o_result; return -OPM_SignedMaximum(bytecount) - 1;
_o_result = -OPM_SignedMaximum(bytecount) - 1;
return _o_result;
} }
int32 OPM_Longint (int64 n) int32 OPM_Longint (int64 n)
{ {
int32 _o_result; return __VAL(int32, n);
_o_result = __VAL(int32, n);
return _o_result;
} }
int16 OPM_Integer (int64 n) int16 OPM_Integer (int64 n)
{ {
int16 _o_result; return __VAL(int16, n);
_o_result = __VAL(int16, n);
return _o_result;
} }
static void OPM_ScanOptions (CHAR *s, LONGINT s__len) static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
BOOLEAN OPM_OpenPar (void) BOOLEAN OPM_OpenPar (void)
{ {
BOOLEAN _o_result;
CHAR s[256]; CHAR s[256];
if (Platform_ArgCount == 1) { if (Platform_ArgCount == 1) {
OPM_LogWLn(); OPM_LogWLn();
@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr(Configuration_versionLong, 75); OPM_LogWStr(Configuration_versionLong, 75);
OPM_LogW('.'); OPM_LogW('.');
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68);
OPM_LogWLn(); OPM_LogWLn();
@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWStr((CHAR*)"Options:", 9);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWStr((CHAR*)" Run time safety", 18);
@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58);
@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn(); OPM_LogWLn();
_o_result = 0; return 0;
return _o_result;
} else { } else {
OPM_AddressSize = 4; OPM_AddressSize = 4;
OPM_GetAlignment(&OPM_Alignment); OPM_GetAlignment(&OPM_Alignment);
@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_GlobalAlignment = OPM_Alignment; OPM_GlobalAlignment = OPM_Alignment;
__COPY(OPM_Model, OPM_GlobalModel, 10); __COPY(OPM_Model, OPM_GlobalModel, 10);
OPM_GlobalOptions = OPM_Options; OPM_GlobalOptions = OPM_Options;
_o_result = 1; return 1;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch)
int32 OPM_SymRInt (void) int32 OPM_SymRInt (void)
{ {
int32 _o_result;
int32 k; int32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
_o_result = k; return k;
return _o_result;
} }
int64 OPM_SymRInt64 (void) int64 OPM_SymRInt64 (void)
{ {
int64 _o_result;
int64 k; int64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
_o_result = k; return k;
return _o_result;
} }
void OPM_SymRSet (uint64 *s) void OPM_SymRSet (uint64 *s)
@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
BOOLEAN OPM_eofSF (void) BOOLEAN OPM_eofSF (void)
{ {
BOOLEAN _o_result; return OPM_oldSF.eof;
_o_result = OPM_oldSF.eof;
return _o_result;
} }
void OPM_SymWCh (CHAR ch) void OPM_SymWCh (CHAR ch)

View file

@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
{ {
BOOLEAN _o_result;
if ((b->form == 11 && x->form == 11)) { if ((b->form == 11 && x->form == 11)) {
b = b->BaseTyp; b = b->BaseTyp;
x = x->BaseTyp; x = x->BaseTyp;
@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
x = x->BaseTyp; x = x->BaseTyp;
} while (!(x == NIL || x == b)); } while (!(x == NIL || x == b));
} }
_o_result = x == b; return x == b;
return _o_result;
} }
static struct ProcedureDeclaration__16 { static struct ProcedureDeclaration__16 {

View file

@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e);
static LONGREAL Ten__9 (int16 e) static LONGREAL Ten__9 (int16 e)
{ {
LONGREAL _o_result;
LONGREAL x, p; LONGREAL x, p;
x = (LONGREAL)1; x = (LONGREAL)1;
p = (LONGREAL)10; p = (LONGREAL)10;
@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e)
p = p * p; p = p * p;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static int16 Ord__7 (CHAR ch, BOOLEAN hex) static int16 Ord__7 (CHAR ch, BOOLEAN hex)
{ {
int16 _o_result;
if (ch <= '9') { if (ch <= '9') {
_o_result = (int16)ch - 48; return (int16)ch - 48;
return _o_result;
} else if (hex) { } else if (hex) {
_o_result = ((int16)ch - 65) + 10; return ((int16)ch - 65) + 10;
return _o_result;
} else { } else {
OPS_err(2); OPS_err(2);
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -324,6 +318,7 @@ void OPS_Get (int8 *sym)
while (OPS_ch <= ' ') { while (OPS_ch <= ' ') {
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
*sym = 64; *sym = 64;
Get__1_s = _s.lnk;
return; return;
} else { } else {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);

View file

@ -179,7 +179,6 @@ static void OPT_err (int16 n)
int16 OPT_IntSize (int64 n) int16 OPT_IntSize (int64 n)
{ {
int16 _o_result;
int16 bytes; int16 bytes;
if (n < 0) { if (n < 0) {
n = -(n + 1); n = -(n + 1);
@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n)
while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) {
bytes += 1; bytes += 1;
} }
_o_result = bytes; return bytes;
return _o_result;
} }
OPT_Struct OPT_IntType (int32 size) OPT_Struct OPT_IntType (int32 size)
{ {
OPT_Struct _o_result;
if (size <= OPT_int8typ->size) { if (size <= OPT_int8typ->size) {
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
if (size <= OPT_int16typ->size) { if (size <= OPT_int16typ->size) {
_o_result = OPT_int16typ; return OPT_int16typ;
return _o_result;
} }
if (size <= OPT_int32typ->size) { if (size <= OPT_int32typ->size) {
_o_result = OPT_int32typ; return OPT_int32typ;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} }
OPT_Struct OPT_SetType (int32 size) OPT_Struct OPT_SetType (int32 size)
{ {
OPT_Struct _o_result;
if (size == OPT_set32typ->size) { if (size == OPT_set32typ->size) {
_o_result = OPT_set32typ; return OPT_set32typ;
return _o_result;
} }
_o_result = OPT_set64typ; return OPT_set64typ;
return _o_result;
} }
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
{ {
OPT_Struct _o_result;
int16 i; int16 i;
__ASSERT(x->form == 4, 0); __ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0); __ASSERT(dir == 1 || dir == -1, 0);
if (dir > 0) { if (dir > 0) {
if (x->size < OPT_sinttyp->size) { if (x->size < OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
if (x->size < OPT_inttyp->size) { if (x->size < OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size < OPT_linttyp->size) { if (x->size < OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} else { } else {
if (x->size > OPT_linttyp->size) { if (x->size > OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
if (x->size > OPT_inttyp->size) { if (x->size > OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size > OPT_sinttyp->size) { if (x->size > OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base)
int32 OPT_SizeAlignment (int32 size) int32 OPT_SizeAlignment (int32 size)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (size < OPM_Alignment) { if (size < OPM_Alignment) {
alignment = 1; alignment = 1;
@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size)
} else { } else {
alignment = OPM_Alignment; alignment = OPM_Alignment;
} }
_o_result = alignment; return alignment;
return _o_result;
} }
int32 OPT_BaseAlignment (OPT_Struct typ) int32 OPT_BaseAlignment (OPT_Struct typ)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (typ->form == 13) { if (typ->form == 13) {
if (typ->comp == 4) { if (typ->comp == 4) {
@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
} else { } else {
alignment = OPT_SizeAlignment(typ->size); alignment = OPT_SizeAlignment(typ->size);
} }
_o_result = alignment; return alignment;
return _o_result;
} }
void OPT_TypSize (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ)
@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ)
OPT_Const OPT_NewConst (void) OPT_Const OPT_NewConst (void)
{ {
OPT_Const _o_result;
OPT_Const const_ = NIL; OPT_Const const_ = NIL;
__NEW(const_, OPT_ConstDesc); __NEW(const_, OPT_ConstDesc);
_o_result = const_; return const_;
return _o_result;
} }
OPT_Object OPT_NewObj (void) OPT_Object OPT_NewObj (void)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
__NEW(obj, OPT_ObjDesc); __NEW(obj, OPT_ObjDesc);
_o_result = obj; return obj;
return _o_result;
} }
OPT_Struct OPT_NewStr (int8 form, int8 comp) OPT_Struct OPT_NewStr (int8 form, int8 comp)
{ {
OPT_Struct _o_result;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc); __NEW(typ, OPT_StrDesc);
typ->form = form; typ->form = form;
@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
} }
typ->size = -1; typ->size = -1;
typ->BaseTyp = OPT_undftyp; typ->BaseTyp = OPT_undftyp;
_o_result = typ; return typ;
return _o_result;
} }
OPT_Node OPT_NewNode (int8 class) OPT_Node OPT_NewNode (int8 class)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc); __NEW(node, OPT_NodeDesc);
node->class = class; node->class = class;
_o_result = node; return node;
return _o_result;
} }
OPT_ConstExt OPT_NewExt (void) OPT_ConstExt OPT_NewExt (void)
{ {
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL; OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, 256); ext = __NEWARR(NIL, 1, 1, 1, 0, 256);
_o_result = ext; return ext;
return _o_result;
} }
void OPT_OpenScope (int8 level, OPT_Object owner) void OPT_OpenScope (int8 level, OPT_Object owner)
@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void) static OPT_Object OPT_InFld (void)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void)
obj->vis = 0; obj->vis = 0;
obj->adr = OPM_SymRInt(); obj->adr = OPM_SymRInt();
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Object OPT_InTProc (int8 mno) static OPT_Object OPT_InTProc (int8 mno)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno)
obj->vis = 0; obj->vis = 0;
obj->adr = __ASHL(OPM_SymRInt(), 16); obj->adr = __ASHL(OPM_SymRInt(), 16);
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Struct OPT_InTyp (int32 tag) static OPT_Struct OPT_InTyp (int32 tag)
{ {
OPT_Struct _o_result;
if (tag == 4) { if (tag == 4) {
_o_result = OPT_IntType(OPM_SymRInt()); return OPT_IntType(OPM_SymRInt());
return _o_result;
} else if (tag == 7) { } else if (tag == 7) {
_o_result = OPT_SetType(OPM_SymRInt()); return OPT_SetType(OPM_SymRInt());
return _o_result;
} else { } else {
_o_result = OPT_impCtxt.ref[__X(tag, 255)]; return OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ)
static OPT_Object OPT_InObj (int8 mno) static OPT_Object OPT_InObj (int8 mno)
{ {
OPT_Object _o_result;
int16 i, s; int16 i, s;
CHAR ch; CHAR ch;
OPT_Object obj = NIL, old = NIL; OPT_Object obj = NIL, old = NIL;
@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno)
} }
} }
} }
_o_result = obj; return obj;
return _o_result;
} }
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)

View file

@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope)
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
{ {
int16 _o_result;
switch (class) { switch (class) {
case 7: case 0: case 2: case 4: case 9: case 7: case 0: case 2: case 4: case 9:
case 13: case 13:
_o_result = 10; return 10;
return _o_result;
break; break;
case 5: case 5:
if (__IN(3, OPM_Options, 32)) { if (__IN(3, OPM_Options, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 1: case 1:
if (__IN(comp, 0x0c, 32)) { if (__IN(comp, 0x0c, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 3: case 3:
_o_result = 9; return 9;
return _o_result;
break; break;
case 11: case 11:
switch (subclass) { switch (subclass) {
case 33: case 7: case 24: case 29: case 20: case 33: case 7: case 24: case 29: case 20:
_o_result = 9; return 9;
return _o_result;
break; break;
case 16: case 21: case 22: case 23: case 25: case 16: case 21: case 22: case 23: case 25:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55);
@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
switch (subclass) { switch (subclass) {
case 1: case 1:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 2: case 2:
if (form == 7) { if (form == 7) {
_o_result = 3; return 3;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 3: case 4: case 3: case 4:
_o_result = 10; return 10;
return _o_result;
break; break;
case 6: case 6:
if (form == 7) { if (form == 7) {
_o_result = 2; return 2;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 7: case 7:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 11: case 12: case 13: case 14: case 11: case 12: case 13: case 14:
_o_result = 6; return 6;
return _o_result;
break; break;
case 9: case 10: case 9: case 10:
_o_result = 5; return 5;
return _o_result;
break; break;
case 5: case 5:
_o_result = 1; return 1;
return _o_result;
break; break;
case 8: case 8:
_o_result = 0; return 0;
return _o_result;
break; break;
case 19: case 15: case 17: case 18: case 26: case 19: case 15: case 17: case 18: case 26:
case 27: case 28: case 27: case 28:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55);
@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
} }
break; break;
case 10: case 10:
_o_result = 10; return 10;
return _o_result;
break; break;
case 8: case 6: case 8: case 6:
_o_result = 12; return 12;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43);
@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim)
static BOOLEAN OPV_SideEffects (OPT_Node n) static BOOLEAN OPV_SideEffects (OPT_Node n)
{ {
BOOLEAN _o_result;
if (n != NIL) { if (n != NIL) {
_o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right);
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
static OPT_Object OPV_SuperProc (OPT_Node n) static OPT_Object OPV_SuperProc (OPT_Node n)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
typ = n->right->typ; typ = n->right->typ;
@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }
OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPV_expr (OPT_Node n, int16 prec) static void OPV_expr (OPT_Node n, int16 prec)
@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
{ {
BOOLEAN _o_result;
while ((n != NIL && n->class != 26)) { while ((n != NIL && n->class != 26)) {
n = n->link; n = n->link;
} }
_o_result = n == NIL; return n == NIL;
return _o_result;
} }
static void OPV_NewArr (OPT_Node d, OPT_Node x) static void OPV_NewArr (OPT_Node d, OPT_Node x)
@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
OPM_WriteString((CHAR*)"__ENDMOD", 9); OPM_WriteString((CHAR*)"__ENDMOD", 9);
} }
} else { } else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);
if (n->left != NIL) { if (n->left != NIL) {
OPM_WriteString((CHAR*)"_o_result = ", 13); OPM_Write(' ');
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8); OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10); OPV_expr(n->left, 10);
} else { } else {
OPV_expr(n->left, -1); OPV_expr(n->left, -1);
} }
OPM_WriteString((CHAR*)";", 2);
OPM_WriteLn();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return _o_result", 17);
} else {
OPM_WriteString((CHAR*)"return", 7);
} }
} }
break; break;

View file

@ -56,14 +56,12 @@ void Out_Char (CHAR ch)
static int32 Out_Length (CHAR *s, LONGINT s__len) static int32 Out_Length (CHAR *s, LONGINT s__len)
{ {
int32 _o_result;
int32 l; int32 l;
l = 0; l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) { while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1; l += 1;
} }
_o_result = l; return l;
return _o_result;
} }
void Out_String (CHAR *str, LONGINT str__len) void Out_String (CHAR *str, LONGINT str__len)
@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
LONGREAL Out_Ten (int16 e) LONGREAL Out_Ten (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)

View file

@ -174,65 +174,47 @@ extern void Heap_InitHeap();
BOOLEAN Platform_TooManyFiles (int16 e) BOOLEAN Platform_TooManyFiles (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EMFILE() || e == Platform_ENFILE();
_o_result = e == Platform_EMFILE() || e == Platform_ENFILE();
return _o_result;
} }
BOOLEAN Platform_NoSuchDirectory (int16 e) BOOLEAN Platform_NoSuchDirectory (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_DifferentFilesystems (int16 e) BOOLEAN Platform_DifferentFilesystems (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EXDEV();
_o_result = e == Platform_EXDEV();
return _o_result;
} }
BOOLEAN Platform_Inaccessible (int16 e) BOOLEAN Platform_Inaccessible (int16 e)
{ {
BOOLEAN _o_result; return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
_o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
return _o_result;
} }
BOOLEAN Platform_Absent (int16 e) BOOLEAN Platform_Absent (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_TimedOut (int16 e) BOOLEAN Platform_TimedOut (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ETIMEDOUT();
_o_result = e == Platform_ETIMEDOUT();
return _o_result;
} }
BOOLEAN Platform_ConnectionFailed (int16 e) BOOLEAN Platform_ConnectionFailed (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
_o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
return _o_result;
} }
BOOLEAN Platform_Interrupted (int16 e) BOOLEAN Platform_Interrupted (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EINTR();
_o_result = e == Platform_EINTR();
return _o_result;
} }
int32 Platform_OSAllocate (int32 size) int32 Platform_OSAllocate (int32 size)
{ {
int32 _o_result; return Platform_allocate(size);
_o_result = Platform_allocate(size);
return _o_result;
} }
void Platform_OSFree (int32 address) void Platform_OSFree (int32 address)
@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr)
BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
{ {
BOOLEAN _o_result;
Platform_EnvPtr p = NIL; Platform_EnvPtr p = NIL;
__DUP(var, var__len, CHAR); __DUP(var, var__len, CHAR);
p = Platform_getenv(var, var__len); p = Platform_getenv(var, var__len);
if (p != NIL) { if (p != NIL) {
__COPY(*p, val, val__len); __COPY(*p, val, val__len);
} }
_o_result = p != NIL;
__DEL(var); __DEL(var);
return _o_result; return p != NIL;
} }
void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val)
int16 Platform_ArgPos (CHAR *s, LONGINT s__len) int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
CHAR arg[256]; CHAR arg[256];
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
i += 1; i += 1;
Platform_GetArg(i, (void*)arg, 256); Platform_GetArg(i, (void*)arg, 256);
} }
_o_result = i;
__DEL(s); __DEL(s);
return _o_result; return i;
} }
void Platform_SetInterruptHandler (Platform_SignalHandler handler) void Platform_SetInterruptHandler (Platform_SignalHandler handler)
@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
int32 Platform_Time (void) int32 Platform_Time (void)
{ {
int32 _o_result;
int32 ms; int32 ms;
Platform_gettimeval(); Platform_gettimeval();
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
} }
void Platform_Delay (int32 ms) void Platform_Delay (int32 ms)
@ -381,126 +357,100 @@ void Platform_Delay (int32 ms)
int16 Platform_System (CHAR *cmd, LONGINT cmd__len) int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{ {
int16 _o_result;
__DUP(cmd, cmd__len, CHAR); __DUP(cmd, cmd__len, CHAR);
_o_result = Platform_system(cmd, cmd__len);
__DEL(cmd); __DEL(cmd);
return _o_result; return Platform_system(cmd, cmd__len);
} }
int16 Platform_Error (void) int16 Platform_Error (void)
{ {
int16 _o_result; return Platform_err();
_o_result = Platform_err();
return _o_result;
} }
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openro(n, n__len); fd = Platform_openro(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openrw(n, n__len); fd = Platform_openrw(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_opennew(n, n__len); fd = Platform_opennew(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Close (int32 h) int16 Platform_Close (int32 h)
{ {
int16 _o_result;
if (Platform_closefile(h) < 0) { if (Platform_closefile(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
__DUP(n, n__len, CHAR); __DUP(n, n__len, CHAR);
Platform_structstats(); Platform_structstats();
if (Platform_stat(n, n__len) < 0) { if (Platform_stat(n, n__len) < 0) {
_o_result = Platform_err();
__DEL(n); __DEL(n);
return _o_result; return Platform_err();
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0;
__DEL(n); __DEL(n);
return _o_result; return 0;
} }
BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (i1.index == i2.index && i1.volume == i2.volume);
_o_result = (i1.index == i2.index && i1.volume == i2.volume);
return _o_result;
} }
BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return i1.mtime == i2.mtime;
_o_result = i1.mtime == i2.mtime;
return _o_result;
} }
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, int32 *l)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
*l = Platform_statsize(); *l = Platform_statsize();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, p, l); *n = Platform_readfile(h, p, l);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, (address)b, b__len); *n = Platform_readfile(h, (address)b, b__len);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Write (int32 h, int32 p, int32 l) int16 Platform_Write (int32 h, int32 p, int32 l)
{ {
int16 _o_result;
int32 written; int32 written;
written = Platform_writefile(h, p, l); written = Platform_writefile(h, p, l);
if (written < 0) { if (written < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Sync (int32 h) int16 Platform_Sync (int32 h)
{ {
int16 _o_result;
if (Platform_fsync(h) < 0) { if (Platform_fsync(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Seek (int32 h, int32 offset, int16 whence) int16 Platform_Seek (int32 h, int32 offset, int16 whence)
{ {
int16 _o_result;
if (Platform_lseek(h, offset, whence) < 0) { if (Platform_lseek(h, offset, whence) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Truncate (int32 h, int32 l) int16 Platform_Truncate (int32 h, int32 l)
{ {
int16 _o_result;
if (Platform_ftruncate(h, l) < 0) { if (Platform_ftruncate(h, l) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Unlink (CHAR *n, LONGINT n__len) int16 Platform_Unlink (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_unlink(n, n__len) < 0) { if (Platform_unlink(n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Chdir (CHAR *n, LONGINT n__len) int16 Platform_Chdir (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
int16 r; int16 r;
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
_o_result = 0; return 0;
return _o_result;
} else { } else {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_rename(o, o__len, n, n__len) < 0) { if (Platform_rename(o, o__len, n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i);
REAL Reals_Ten (int16 e) REAL Reals_Ten (int16 e)
{ {
REAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
LONGREAL Reals_TenL (int16 e) LONGREAL Reals_TenL (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e)
} }
e = __ASHR(e, 1); e = __ASHR(e, 1);
if (e <= 0) { if (e <= 0) {
_o_result = r; return r;
return _o_result;
} }
power = power * power; power = power * power;
} }
@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e)
int16 Reals_Expo (REAL x) int16 Reals_Expo (REAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 2, i, int16); __GET((address)&x + 2, i, int16);
_o_result = __MASK(__ASHR(i, 7), -256); return __MASK(__ASHR(i, 7), -256);
return _o_result;
} }
void Reals_SetExpo (REAL *x, int16 ex) void Reals_SetExpo (REAL *x, int16 ex)
@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex)
int16 Reals_ExpoL (LONGREAL x) int16 Reals_ExpoL (LONGREAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 6, i, int16); __GET((address)&x + 6, i, int16);
_o_result = __MASK(__ASHR(i, 4), -2048); return __MASK(__ASHR(i, 4), -2048);
return _o_result;
} }
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
static CHAR Reals_ToHex (int16 i) static CHAR Reals_ToHex (int16 i)
{ {
CHAR _o_result;
if (i < 10) { if (i < 10) {
_o_result = (CHAR)(i + 48); return (CHAR)(i + 48);
return _o_result;
} else { } else {
_o_result = (CHAR)(i + 55); return (CHAR)(i + 55);
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR
int16 Strings_Length (CHAR *s, LONGINT s__len) int16 Strings_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int32 i; int32 i;
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
i = 0; i = 0;
@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
i += 1; i += 1;
} }
if (i <= 32767) { if (i <= 32767) {
_o_result = (int16)i;
__DEL(s); __DEL(s);
return _o_result; return (int16)i;
} else { } else {
_o_result = 32767;
__DEL(s); __DEL(s);
return _o_result; return 32767;
} }
__RETCHK; __RETCHK;
} }
@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
} }
if (pos > n1) { if (pos > n1) {
Strings_Append(dest, dest__len, (void*)source, source__len); Strings_Append(dest, dest__len, (void*)source, source__len);
__DEL(source);
return; return;
} }
if ((pos + n2) < dest__len) { if ((pos + n2) < dest__len) {
@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
} }
if (pos >= len) { if (pos >= len) {
dest[0] = 0x00; dest[0] = 0x00;
__DEL(source);
return; return;
} }
i = 0; i = 0;
@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
{ {
int16 _o_result;
int16 n1, n2, i, j; int16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len); n1 = Strings_Length(s, s__len);
n2 = Strings_Length(pattern, pattern__len); n2 = Strings_Length(pattern, pattern__len);
if (n2 == 0) { if (n2 == 0) {
_o_result = 0;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return 0;
} }
i = pos; i = pos;
while (i <= n1 - n2) { while (i <= n1 - n2) {
@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
j += 1; j += 1;
} }
if (j == n2) { if (j == n2) {
_o_result = i;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return i;
} }
} }
i += 1; i += 1;
} }
_o_result = -1;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return -1;
} }
void Strings_Cap (CHAR *s, LONGINT s__len) void Strings_Cap (CHAR *s, LONGINT s__len)
@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
{ {
BOOLEAN _o_result;
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {
_o_result = 0; return 0;
return _o_result;
} }
n -= 1; n -= 1;
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = n < 0; return n < 0;
return _o_result;
} }
while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { while ((m >= 0 && mask[__X(m, mask__len)] == '*')) {
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = 1; return 1;
return _o_result;
} }
while (n >= 0) { while (n >= 0) {
if (M__8(name, name__len, mask, mask__len, n, m)) { if (M__8(name, name__len, mask, mask__len, n, m)) {
_o_result = 1; return 1;
return _o_result;
} }
n -= 1; n -= 1;
} }
_o_result = 0; return 0;
return _o_result;
} }
BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len)
{ {
BOOLEAN _o_result;
struct Match__7 _s; struct Match__7 _s;
__DUP(string, string__len, CHAR); __DUP(string, string__len, CHAR);
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
_s.lnk = Match__7_s; _s.lnk = Match__7_s;
Match__7_s = &_s; Match__7_s = &_s;
_o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
Match__7_s = _s.lnk; Match__7_s = _s.lnk;
__DEL(string); __DEL(string);
__DEL(pattern); __DEL(pattern);
return _o_result; return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
} }

View file

@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
{ {
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL; Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc); __NEW(F, Texts_FontDesc);
__COPY(name, F->name, 32); __COPY(name, F->name, 32);
_o_result = F; return F;
return _o_result;
} }
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas
static Texts_Piece Texts_ClonePiece (Texts_Piece p) static Texts_Piece Texts_ClonePiece (Texts_Piece p)
{ {
Texts_Piece _o_result;
Texts_Piece q = NIL; Texts_Piece q = NIL;
__NEW(q, Texts_PieceDesc); __NEW(q, Texts_PieceDesc);
__GUARDEQP(q, Texts_PieceDesc) = *p; __GUARDEQP(q, Texts_PieceDesc) = *p;
_o_result = q; return q;
return _o_result;
} }
static Texts_Elem Texts_CloneElem (Texts_Elem e) static Texts_Elem Texts_CloneElem (Texts_Elem e)
{ {
Texts_Elem _o_result;
Texts_CopyMsg msg; Texts_CopyMsg msg;
msg.e = NIL; msg.e = NIL;
(*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ);
_o_result = msg.e; return msg.e;
return _o_result;
} }
void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
Texts_Text Texts_ElemBase (Texts_Elem E) Texts_Text Texts_ElemBase (Texts_Elem E)
{ {
Texts_Text _o_result; return E->base;
_o_result = E->base;
return _o_result;
} }
int32 Texts_ElemPos (Texts_Elem E) int32 Texts_ElemPos (Texts_Elem E)
{ {
int32 _o_result;
Texts_Run u = NIL; Texts_Run u = NIL;
int32 pos; int32 pos;
u = E->base->head->next; u = E->base->head->next;
@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E)
pos = pos + u->len; pos = pos + u->len;
u = u->next; u = u->next;
} }
_o_result = pos; return pos;
return _o_result;
} }
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
int32 Texts_Pos (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ)
{ {
int32 _o_result; return (*R).org + (*R).off;
_o_result = (*R).org + (*R).off;
return _o_result;
} }
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)

View file

@ -317,14 +317,11 @@ void Files_Close (Files_File f)
int32 Files_Length (Files_File f) int32 Files_Length (Files_File f)
{ {
int32 _o_result; return f->len;
_o_result = f->len;
return _o_result;
} }
Files_File Files_New (CHAR *name, LONGINT name__len) Files_File Files_New (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
f->len = 0; f->len = 0;
f->pos = 0; f->pos = 0;
f->swapper = -1; f->swapper = -1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
CHAR ch; CHAR ch;
i = 0; i = 0;
@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
i += 1; i += 1;
ch = name[i]; ch = name[i];
} }
_o_result = ch == '/'; return ch == '/';
return _o_result;
} }
static Files_File Files_CacheEntry (Platform_FileIdentity identity) static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int16 i, error; int16 i, error;
f = Files_files; f = Files_files;
@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
f->identity = identity; f->identity = identity;
error = Platform_Size(f->fd, &f->len); error = Platform_Size(f->fd, &f->len);
} }
_o_result = f; return f;
return _o_result;
} }
f = f->next; f = f->next;
} }
_o_result = NIL; return NIL;
return _o_result;
} }
Files_File Files_Old (CHAR *name, LONGINT name__len) Files_File Files_Old (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int32 fd; int32 fd;
int16 pos; int16 pos;
@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
f = Files_CacheEntry(identity); f = Files_CacheEntry(identity);
if (f != NIL) { if (f != NIL) {
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} else { } else {
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
Heap_RegisterFinalizer((void*)f, Files_Finalize); Heap_RegisterFinalizer((void*)f, Files_Finalize);
@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->next = Files_files; f->next = Files_files;
Files_files = f; Files_files = f;
Heap_FileCount += 1; Heap_FileCount += 1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
} else if (dir[0] == 0x00) { } else if (dir[0] == 0x00) {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} else { } else {
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256); Files_ScanPath(&pos, (void*)dir, 256);
} }
} }
} else { } else {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }
@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d)
int32 Files_Pos (Files_Rider *r, address *r__typ) int32 Files_Pos (Files_Rider *r, address *r__typ)
{ {
int32 _o_result; return (*r).org + (*r).offset;
_o_result = (*r).org + (*r).offset;
return _o_result;
} }
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
Files_File Files_Base (Files_Rider *r, address *r__typ) Files_File Files_Base (Files_Rider *r, address *r__typ)
{ {
Files_File _o_result; return (*r).buf->f;
_o_result = (*r).buf->f;
return _o_result;
} }
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
error = Platform_Rename((void*)old, old__len, (void*)new, new__len); error = Platform_Rename((void*)old, old__len, (void*)new, new__len);
if (!Platform_DifferentFilesystems(error)) { if (!Platform_DifferentFilesystems(error)) {
*res = error; *res = error;
__DEL(old);
__DEL(new);
return; return;
} else { } else {
error = Platform_OldRO((void*)old, old__len, &fdold); error = Platform_OldRO((void*)old, old__len, &fdold);
if (error != 0) { if (error != 0) {
*res = 2; *res = 2;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_New((void*)new, new__len, &fdnew); error = Platform_New((void*)new, new__len, &fdnew);
if (error != 0) { if (error != 0) {
error = Platform_Close(fdold); error = Platform_Close(fdold);
*res = 3; *res = 3;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_Read(fdold, (address)buf, 4096, &n); error = Platform_Read(fdold, (address)buf, 4096, &n);

View file

@ -127,7 +127,6 @@ void Heap_Unlock (void)
SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
{ {
SYSTEM_PTR _o_result;
Heap_Module m; Heap_Module m;
if (__STRCMP(name, "Heap") == 0) { if (__STRCMP(name, "Heap") == 0) {
__SYSNEW(m, 48); __SYSNEW(m, 48);
@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
m->enumPtrs = enumPtrs; m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(address)Heap_modules; m->next = (Heap_Module)(address)Heap_modules;
Heap_modules = (SYSTEM_PTR)m; Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m; return (void*)m;
return _o_result;
} }
void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m)
static int32 Heap_NewChunk (int32 blksz) static int32 Heap_NewChunk (int32 blksz)
{ {
int32 _o_result;
int32 chnk; int32 chnk;
chnk = Heap_OSAllocate(blksz + 12); chnk = Heap_OSAllocate(blksz + 12);
if (chnk != 0) { if (chnk != 0) {
@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz)
Heap_bigBlocks = chnk + 12; Heap_bigBlocks = chnk + 12;
Heap_heapsize += blksz; Heap_heapsize += blksz;
} }
_o_result = chnk; return chnk;
return _o_result;
} }
static void Heap_ExtendHeap (int32 blksz) static void Heap_ExtendHeap (int32 blksz)
@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz)
SYSTEM_PTR Heap_NEWREC (int32 tag) SYSTEM_PTR Heap_NEWREC (int32 tag)
{ {
SYSTEM_PTR _o_result;
int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
new = Heap_NEWREC(tag); new = Heap_NEWREC(tag);
} }
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} else { } else {
Heap_Unlock(); Heap_Unlock();
_o_result = NIL; return NIL;
return _o_result;
} }
} }
__GET(adr + 4, t, int32); __GET(adr + 4, t, int32);
@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
__PUT(adr + 8, 0, int32); __PUT(adr + 8, 0, int32);
Heap_allocated += blksz; Heap_allocated += blksz;
Heap_Unlock(); Heap_Unlock();
_o_result = (SYSTEM_PTR)(address)(adr + 4); return (SYSTEM_PTR)(address)(adr + 4);
return _o_result;
} }
SYSTEM_PTR Heap_NEWBLK (int32 size) SYSTEM_PTR Heap_NEWBLK (int32 size)
{ {
SYSTEM_PTR _o_result;
int32 blksz, tag; int32 blksz, tag;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size)
__PUT(tag + 4, -4, int32); __PUT(tag + 4, -4, int32);
__PUT((int32)(address)new - 4, tag, int32); __PUT((int32)(address)new - 4, tag, int32);
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} }
static void Heap_Mark (int32 q) static void Heap_Mark (int32 q)

View file

@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
{ {
Modules_Module _o_result;
Modules_Module m = NIL; Modules_Module m = NIL;
CHAR bodyname[64]; CHAR bodyname[64];
Modules_Command body; Modules_Command body;
@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
} }
_o_result = m;
__DEL(name); __DEL(name);
return _o_result; return m;
} }
Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len)
{ {
Modules_Command _o_result;
Modules_Cmd c = NIL; Modules_Cmd c = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
c = mod->cmds; c = mod->cmds;
@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
if (c != NIL) { if (c != NIL) {
Modules_res = 0; Modules_res = 0;
Modules_resMsg[0] = 0x00; Modules_resMsg[0] = 0x00;
_o_result = c->cmd;
__DEL(name); __DEL(name);
return _o_result; return c->cmd;
} else { } else {
Modules_res = 2; Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11); __MOVE(" command \"", Modules_resMsg, 11);
@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }

View file

@ -74,7 +74,6 @@ static void OPB_err (int16 n)
OPT_Node OPB_NewLeaf (OPT_Object obj) OPT_Node OPB_NewLeaf (OPT_Object obj)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
switch (obj->mode) { switch (obj->mode) {
case 1: case 1:
@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
} }
node->obj = obj; node->obj = obj;
node->typ = obj->typ; node->typ = obj->typ;
_o_result = node; return node;
return _o_result;
} }
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
static int16 OPB_BoolToInt (BOOLEAN b) static int16 OPB_BoolToInt (BOOLEAN b)
{ {
int16 _o_result;
if (b) { if (b) {
_o_result = 1; return 1;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
static BOOLEAN OPB_IntToBool (int64 i) static BOOLEAN OPB_IntToBool (int64 i)
{ {
BOOLEAN _o_result; return i != 0;
_o_result = i != 0;
return _o_result;
} }
OPT_Node OPB_NewBoolConst (BOOLEAN boolval) OPT_Node OPB_NewBoolConst (BOOLEAN boolval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_booltyp; x->typ = OPT_booltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = OPB_BoolToInt(boolval); x->conval->intval = OPB_BoolToInt(boolval);
_o_result = x; return x;
return _o_result;
} }
void OPB_OptIf (OPT_Node *x) void OPB_OptIf (OPT_Node *x)
@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x)
OPT_Node OPB_Nil (void) OPT_Node OPB_Nil (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_niltyp; x->typ = OPT_niltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = 0; x->conval->intval = 0;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_EmptySet (void) OPT_Node OPB_EmptySet (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_settyp; x->typ = OPT_settyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->setval = 0x0; x->conval->setval = 0x0;
_o_result = x; return x;
return _o_result;
} }
static void OPB_SetIntType (OPT_Node node) static void OPB_SetIntType (OPT_Node node)
@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node)
OPT_Node OPB_NewIntConst (int64 intval) OPT_Node OPB_NewIntConst (int64 intval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = intval; x->conval->intval = intval;
OPB_SetIntType(x); OPB_SetIntType(x);
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->realval = realval; x->conval->realval = realval;
x->typ = typ; x->typ = typ;
x->conval->intval = -1; x->conval->intval = -1;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewString (OPS_String str, int64 len) OPT_Node OPB_NewString (OPS_String str, int64 len)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len)
x->conval->intval2 = OPM_Longint(len); x->conval->intval2 = OPM_Longint(len);
x->conval->ext = OPT_NewExt(); x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, 256); __COPY(str, *x->conval->ext, 256);
_o_result = x; return x;
return _o_result;
} }
static void OPB_CharToString (OPT_Node n) static void OPB_CharToString (OPT_Node n)
@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN OPB_NotVar (OPT_Node x) static BOOLEAN OPB_NotVar (OPT_Node x)
{ {
BOOLEAN _o_result; return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
_o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
return _o_result;
} }
void OPB_DeRef (OPT_Node *x) void OPB_DeRef (OPT_Node *x)
@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y)
static int64 OPB_log (int64 x) static int64 OPB_log (int64 x)
{ {
int64 _o_result;
OPB_exp = 0; OPB_exp = 0;
if (x > 0) { if (x > 0) {
while (!__ODD(x)) { while (!__ODD(x)) {
@ -497,8 +475,7 @@ static int64 OPB_log (int64 x)
OPB_exp += 1; OPB_exp += 1;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(11); node = OPT_NewNode(11);
node->subcl = op; node->subcl = op;
node->typ = typ; node->typ = typ;
node->left = z; node->left = z;
_o_result = node; return node;
return _o_result;
} }
void OPB_MOp (int8 op, OPT_Node *x) void OPB_MOp (int8 op, OPT_Node *x)
@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void) static int16 ConstCmp__14 (void)
{ {
int16 _o_result;
int16 res; int16 res;
switch (*ConstOp__13_s->f) { switch (*ConstOp__13_s->f) {
case 0: case 0:
@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void)
break; break;
} }
(*ConstOp__13_s->x)->typ = OPT_booltyp; (*ConstOp__13_s->x)->typ = OPT_booltyp;
_o_result = res; return res;
return _o_result;
} }
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
{ {
BOOLEAN _o_result;
BOOLEAN ok, xCharArr, yCharArr; BOOLEAN ok, xCharArr, yCharArr;
xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8;
yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8;
@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
OPB_Index(&*x, OPB_NewIntConst(0)); OPB_Index(&*x, OPB_NewIntConst(0));
} }
} }
_o_result = ok; return ok;
return _o_result;
} }
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(class); node = OPT_NewNode(class);
node->subcl = subcl; node->subcl = subcl;
node->left = left; node->left = left;
node->right = right; node->right = right;
_o_result = node; return node;
return _o_result;
} }
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)

View file

@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static int16 OPC_Length (CHAR *s, LONGINT s__len) static int16 OPC_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
i = 0; i = 0;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
i += 1; i += 1;
} }
_o_result = i; return i;
return _o_result;
} }
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i, h; int16 i, h;
i = 0; i = 0;
h = 0; h = 0;
@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
h = 3 * h + (int16)s[__X(i, s__len)]; h = 3 * h + (int16)s[__X(i, s__len)];
i += 1; i += 1;
} }
_o_result = (int)__MOD(h, 105); return (int)__MOD(h, 105);
return _o_result;
} }
void OPC_Ident (OPT_Object obj) void OPC_Ident (OPT_Object obj)
@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
_o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result;
} }
static void OPC_DeclareBase (OPT_Object dcl) static void OPC_DeclareBase (OPT_Object dcl)
@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
int32 OPC_NofPtrs (OPT_Struct typ) int32 OPC_NofPtrs (OPT_Struct typ)
{ {
int32 _o_result;
OPT_Object fld = NIL; OPT_Object fld = NIL;
OPT_Struct btyp = NIL; OPT_Struct btyp = NIL;
int32 n; int32 n;
if ((typ->form == 11 && typ->sysflag == 0)) { if ((typ->form == 11 && typ->sysflag == 0)) {
_o_result = 1; return 1;
return _o_result;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp != NIL) { if (btyp != NIL) {
@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ)
} }
fld = fld->link; fld = fld->link;
} }
_o_result = n; return n;
return _o_result;
} else if (typ->comp == 2) { } else if (typ->comp == 2) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
n = typ->n; n = typ->n;
@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ)
n = btyp->n * n; n = btyp->n * n;
btyp = btyp->BaseTyp; btyp = btyp->BaseTyp;
} }
_o_result = OPC_NofPtrs(btyp) * n; return OPC_NofPtrs(btyp) * n;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Object OPC_BaseTProc (OPT_Object obj)
{ {
OPT_Object _o_result;
OPT_Struct typ = NIL, base = NIL; OPT_Struct typ = NIL, base = NIL;
int32 mno; int32 mno;
typ = obj->link->typ; typ = obj->link->typ;
@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj)
base = typ->BaseTyp; base = typ->BaseTyp;
} }
OPT_FindField(obj->name, typ, &obj); OPT_FindField(obj->name, typ, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
BOOLEAN r;
__DUP(y, y__len, CHAR); __DUP(y, y__len, CHAR);
i = 0; i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
i += 1; i += 1;
} }
r = y[__X(i, y__len)] == 0x00;
_o_result = r;
__DEL(y); __DEL(y);
return _o_result; return y[__X(i, y__len)] == 0x00;
} }
static void OPC_CProcDefs (OPT_Object obj, int16 vis) static void OPC_CProcDefs (OPT_Object obj, int16 vis)
@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc)
} }
OPC_ProcHeader(proc, 1); OPC_ProcHeader(proc, 1);
OPC_BegBlk(); OPC_BegBlk();
if (proc->typ != OPT_notyp) {
OPC_BegStat();
OPC_Ident(proc->typ->strobj);
OPM_WriteString((CHAR*)" _o_result;", 12);
OPM_WriteLn();
}
scope = proc->scope; scope = proc->scope;
OPC_IdentList(scope->scope, 0); OPC_IdentList(scope->scope, 0);
if (!scope->leaf) { if (!scope->leaf) {

View file

@ -124,33 +124,25 @@ void OPM_LogWLn (void)
int64 OPM_SignedMaximum (int32 bytecount) int64 OPM_SignedMaximum (int32 bytecount)
{ {
int64 _o_result;
int64 result; int64 result;
result = 1; result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
_o_result = result - 1; return result - 1;
return _o_result;
} }
int64 OPM_SignedMinimum (int32 bytecount) int64 OPM_SignedMinimum (int32 bytecount)
{ {
int64 _o_result; return -OPM_SignedMaximum(bytecount) - 1;
_o_result = -OPM_SignedMaximum(bytecount) - 1;
return _o_result;
} }
int32 OPM_Longint (int64 n) int32 OPM_Longint (int64 n)
{ {
int32 _o_result; return __VAL(int32, n);
_o_result = __VAL(int32, n);
return _o_result;
} }
int16 OPM_Integer (int64 n) int16 OPM_Integer (int64 n)
{ {
int16 _o_result; return __VAL(int16, n);
_o_result = __VAL(int16, n);
return _o_result;
} }
static void OPM_ScanOptions (CHAR *s, LONGINT s__len) static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
BOOLEAN OPM_OpenPar (void) BOOLEAN OPM_OpenPar (void)
{ {
BOOLEAN _o_result;
CHAR s[256]; CHAR s[256];
if (Platform_ArgCount == 1) { if (Platform_ArgCount == 1) {
OPM_LogWLn(); OPM_LogWLn();
@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr(Configuration_versionLong, 75); OPM_LogWStr(Configuration_versionLong, 75);
OPM_LogW('.'); OPM_LogW('.');
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68);
OPM_LogWLn(); OPM_LogWLn();
@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWStr((CHAR*)"Options:", 9);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWStr((CHAR*)" Run time safety", 18);
@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58);
@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn(); OPM_LogWLn();
_o_result = 0; return 0;
return _o_result;
} else { } else {
OPM_AddressSize = 4; OPM_AddressSize = 4;
OPM_GetAlignment(&OPM_Alignment); OPM_GetAlignment(&OPM_Alignment);
@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_GlobalAlignment = OPM_Alignment; OPM_GlobalAlignment = OPM_Alignment;
__COPY(OPM_Model, OPM_GlobalModel, 10); __COPY(OPM_Model, OPM_GlobalModel, 10);
OPM_GlobalOptions = OPM_Options; OPM_GlobalOptions = OPM_Options;
_o_result = 1; return 1;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch)
int32 OPM_SymRInt (void) int32 OPM_SymRInt (void)
{ {
int32 _o_result;
int32 k; int32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
_o_result = k; return k;
return _o_result;
} }
int64 OPM_SymRInt64 (void) int64 OPM_SymRInt64 (void)
{ {
int64 _o_result;
int64 k; int64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
_o_result = k; return k;
return _o_result;
} }
void OPM_SymRSet (uint64 *s) void OPM_SymRSet (uint64 *s)
@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
BOOLEAN OPM_eofSF (void) BOOLEAN OPM_eofSF (void)
{ {
BOOLEAN _o_result; return OPM_oldSF.eof;
_o_result = OPM_oldSF.eof;
return _o_result;
} }
void OPM_SymWCh (CHAR ch) void OPM_SymWCh (CHAR ch)

View file

@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
{ {
BOOLEAN _o_result;
if ((b->form == 11 && x->form == 11)) { if ((b->form == 11 && x->form == 11)) {
b = b->BaseTyp; b = b->BaseTyp;
x = x->BaseTyp; x = x->BaseTyp;
@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
x = x->BaseTyp; x = x->BaseTyp;
} while (!(x == NIL || x == b)); } while (!(x == NIL || x == b));
} }
_o_result = x == b; return x == b;
return _o_result;
} }
static struct ProcedureDeclaration__16 { static struct ProcedureDeclaration__16 {

View file

@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e);
static LONGREAL Ten__9 (int16 e) static LONGREAL Ten__9 (int16 e)
{ {
LONGREAL _o_result;
LONGREAL x, p; LONGREAL x, p;
x = (LONGREAL)1; x = (LONGREAL)1;
p = (LONGREAL)10; p = (LONGREAL)10;
@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e)
p = p * p; p = p * p;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static int16 Ord__7 (CHAR ch, BOOLEAN hex) static int16 Ord__7 (CHAR ch, BOOLEAN hex)
{ {
int16 _o_result;
if (ch <= '9') { if (ch <= '9') {
_o_result = (int16)ch - 48; return (int16)ch - 48;
return _o_result;
} else if (hex) { } else if (hex) {
_o_result = ((int16)ch - 65) + 10; return ((int16)ch - 65) + 10;
return _o_result;
} else { } else {
OPS_err(2); OPS_err(2);
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -324,6 +318,7 @@ void OPS_Get (int8 *sym)
while (OPS_ch <= ' ') { while (OPS_ch <= ' ') {
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
*sym = 64; *sym = 64;
Get__1_s = _s.lnk;
return; return;
} else { } else {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);

View file

@ -179,7 +179,6 @@ static void OPT_err (int16 n)
int16 OPT_IntSize (int64 n) int16 OPT_IntSize (int64 n)
{ {
int16 _o_result;
int16 bytes; int16 bytes;
if (n < 0) { if (n < 0) {
n = -(n + 1); n = -(n + 1);
@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n)
while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) {
bytes += 1; bytes += 1;
} }
_o_result = bytes; return bytes;
return _o_result;
} }
OPT_Struct OPT_IntType (int32 size) OPT_Struct OPT_IntType (int32 size)
{ {
OPT_Struct _o_result;
if (size <= OPT_int8typ->size) { if (size <= OPT_int8typ->size) {
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
if (size <= OPT_int16typ->size) { if (size <= OPT_int16typ->size) {
_o_result = OPT_int16typ; return OPT_int16typ;
return _o_result;
} }
if (size <= OPT_int32typ->size) { if (size <= OPT_int32typ->size) {
_o_result = OPT_int32typ; return OPT_int32typ;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} }
OPT_Struct OPT_SetType (int32 size) OPT_Struct OPT_SetType (int32 size)
{ {
OPT_Struct _o_result;
if (size == OPT_set32typ->size) { if (size == OPT_set32typ->size) {
_o_result = OPT_set32typ; return OPT_set32typ;
return _o_result;
} }
_o_result = OPT_set64typ; return OPT_set64typ;
return _o_result;
} }
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
{ {
OPT_Struct _o_result;
int16 i; int16 i;
__ASSERT(x->form == 4, 0); __ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0); __ASSERT(dir == 1 || dir == -1, 0);
if (dir > 0) { if (dir > 0) {
if (x->size < OPT_sinttyp->size) { if (x->size < OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
if (x->size < OPT_inttyp->size) { if (x->size < OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size < OPT_linttyp->size) { if (x->size < OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} else { } else {
if (x->size > OPT_linttyp->size) { if (x->size > OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
if (x->size > OPT_inttyp->size) { if (x->size > OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size > OPT_sinttyp->size) { if (x->size > OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base)
int32 OPT_SizeAlignment (int32 size) int32 OPT_SizeAlignment (int32 size)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (size < OPM_Alignment) { if (size < OPM_Alignment) {
alignment = 1; alignment = 1;
@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size)
} else { } else {
alignment = OPM_Alignment; alignment = OPM_Alignment;
} }
_o_result = alignment; return alignment;
return _o_result;
} }
int32 OPT_BaseAlignment (OPT_Struct typ) int32 OPT_BaseAlignment (OPT_Struct typ)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (typ->form == 13) { if (typ->form == 13) {
if (typ->comp == 4) { if (typ->comp == 4) {
@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
} else { } else {
alignment = OPT_SizeAlignment(typ->size); alignment = OPT_SizeAlignment(typ->size);
} }
_o_result = alignment; return alignment;
return _o_result;
} }
void OPT_TypSize (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ)
@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ)
OPT_Const OPT_NewConst (void) OPT_Const OPT_NewConst (void)
{ {
OPT_Const _o_result;
OPT_Const const_ = NIL; OPT_Const const_ = NIL;
__NEW(const_, OPT_ConstDesc); __NEW(const_, OPT_ConstDesc);
_o_result = const_; return const_;
return _o_result;
} }
OPT_Object OPT_NewObj (void) OPT_Object OPT_NewObj (void)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
__NEW(obj, OPT_ObjDesc); __NEW(obj, OPT_ObjDesc);
_o_result = obj; return obj;
return _o_result;
} }
OPT_Struct OPT_NewStr (int8 form, int8 comp) OPT_Struct OPT_NewStr (int8 form, int8 comp)
{ {
OPT_Struct _o_result;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc); __NEW(typ, OPT_StrDesc);
typ->form = form; typ->form = form;
@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
} }
typ->size = -1; typ->size = -1;
typ->BaseTyp = OPT_undftyp; typ->BaseTyp = OPT_undftyp;
_o_result = typ; return typ;
return _o_result;
} }
OPT_Node OPT_NewNode (int8 class) OPT_Node OPT_NewNode (int8 class)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc); __NEW(node, OPT_NodeDesc);
node->class = class; node->class = class;
_o_result = node; return node;
return _o_result;
} }
OPT_ConstExt OPT_NewExt (void) OPT_ConstExt OPT_NewExt (void)
{ {
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL; OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, 256); ext = __NEWARR(NIL, 1, 1, 1, 0, 256);
_o_result = ext; return ext;
return _o_result;
} }
void OPT_OpenScope (int8 level, OPT_Object owner) void OPT_OpenScope (int8 level, OPT_Object owner)
@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void) static OPT_Object OPT_InFld (void)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void)
obj->vis = 0; obj->vis = 0;
obj->adr = OPM_SymRInt(); obj->adr = OPM_SymRInt();
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Object OPT_InTProc (int8 mno) static OPT_Object OPT_InTProc (int8 mno)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno)
obj->vis = 0; obj->vis = 0;
obj->adr = __ASHL(OPM_SymRInt(), 16); obj->adr = __ASHL(OPM_SymRInt(), 16);
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Struct OPT_InTyp (int32 tag) static OPT_Struct OPT_InTyp (int32 tag)
{ {
OPT_Struct _o_result;
if (tag == 4) { if (tag == 4) {
_o_result = OPT_IntType(OPM_SymRInt()); return OPT_IntType(OPM_SymRInt());
return _o_result;
} else if (tag == 7) { } else if (tag == 7) {
_o_result = OPT_SetType(OPM_SymRInt()); return OPT_SetType(OPM_SymRInt());
return _o_result;
} else { } else {
_o_result = OPT_impCtxt.ref[__X(tag, 255)]; return OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ)
static OPT_Object OPT_InObj (int8 mno) static OPT_Object OPT_InObj (int8 mno)
{ {
OPT_Object _o_result;
int16 i, s; int16 i, s;
CHAR ch; CHAR ch;
OPT_Object obj = NIL, old = NIL; OPT_Object obj = NIL, old = NIL;
@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno)
} }
} }
} }
_o_result = obj; return obj;
return _o_result;
} }
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)

View file

@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope)
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
{ {
int16 _o_result;
switch (class) { switch (class) {
case 7: case 0: case 2: case 4: case 9: case 7: case 0: case 2: case 4: case 9:
case 13: case 13:
_o_result = 10; return 10;
return _o_result;
break; break;
case 5: case 5:
if (__IN(3, OPM_Options, 32)) { if (__IN(3, OPM_Options, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 1: case 1:
if (__IN(comp, 0x0c, 32)) { if (__IN(comp, 0x0c, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 3: case 3:
_o_result = 9; return 9;
return _o_result;
break; break;
case 11: case 11:
switch (subclass) { switch (subclass) {
case 33: case 7: case 24: case 29: case 20: case 33: case 7: case 24: case 29: case 20:
_o_result = 9; return 9;
return _o_result;
break; break;
case 16: case 21: case 22: case 23: case 25: case 16: case 21: case 22: case 23: case 25:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55);
@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
switch (subclass) { switch (subclass) {
case 1: case 1:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 2: case 2:
if (form == 7) { if (form == 7) {
_o_result = 3; return 3;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 3: case 4: case 3: case 4:
_o_result = 10; return 10;
return _o_result;
break; break;
case 6: case 6:
if (form == 7) { if (form == 7) {
_o_result = 2; return 2;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 7: case 7:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 11: case 12: case 13: case 14: case 11: case 12: case 13: case 14:
_o_result = 6; return 6;
return _o_result;
break; break;
case 9: case 10: case 9: case 10:
_o_result = 5; return 5;
return _o_result;
break; break;
case 5: case 5:
_o_result = 1; return 1;
return _o_result;
break; break;
case 8: case 8:
_o_result = 0; return 0;
return _o_result;
break; break;
case 19: case 15: case 17: case 18: case 26: case 19: case 15: case 17: case 18: case 26:
case 27: case 28: case 27: case 28:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55);
@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
} }
break; break;
case 10: case 10:
_o_result = 10; return 10;
return _o_result;
break; break;
case 8: case 6: case 8: case 6:
_o_result = 12; return 12;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43);
@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim)
static BOOLEAN OPV_SideEffects (OPT_Node n) static BOOLEAN OPV_SideEffects (OPT_Node n)
{ {
BOOLEAN _o_result;
if (n != NIL) { if (n != NIL) {
_o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right);
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
static OPT_Object OPV_SuperProc (OPT_Node n) static OPT_Object OPV_SuperProc (OPT_Node n)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
typ = n->right->typ; typ = n->right->typ;
@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }
OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPV_expr (OPT_Node n, int16 prec) static void OPV_expr (OPT_Node n, int16 prec)
@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
{ {
BOOLEAN _o_result;
while ((n != NIL && n->class != 26)) { while ((n != NIL && n->class != 26)) {
n = n->link; n = n->link;
} }
_o_result = n == NIL; return n == NIL;
return _o_result;
} }
static void OPV_NewArr (OPT_Node d, OPT_Node x) static void OPV_NewArr (OPT_Node d, OPT_Node x)
@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
OPM_WriteString((CHAR*)"__ENDMOD", 9); OPM_WriteString((CHAR*)"__ENDMOD", 9);
} }
} else { } else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);
if (n->left != NIL) { if (n->left != NIL) {
OPM_WriteString((CHAR*)"_o_result = ", 13); OPM_Write(' ');
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8); OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10); OPV_expr(n->left, 10);
} else { } else {
OPV_expr(n->left, -1); OPV_expr(n->left, -1);
} }
OPM_WriteString((CHAR*)";", 2);
OPM_WriteLn();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return _o_result", 17);
} else {
OPM_WriteString((CHAR*)"return", 7);
} }
} }
break; break;

View file

@ -56,14 +56,12 @@ void Out_Char (CHAR ch)
static int32 Out_Length (CHAR *s, LONGINT s__len) static int32 Out_Length (CHAR *s, LONGINT s__len)
{ {
int32 _o_result;
int32 l; int32 l;
l = 0; l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) { while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1; l += 1;
} }
_o_result = l; return l;
return _o_result;
} }
void Out_String (CHAR *str, LONGINT str__len) void Out_String (CHAR *str, LONGINT str__len)
@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
LONGREAL Out_Ten (int16 e) LONGREAL Out_Ten (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)

View file

@ -174,65 +174,47 @@ extern void Heap_InitHeap();
BOOLEAN Platform_TooManyFiles (int16 e) BOOLEAN Platform_TooManyFiles (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EMFILE() || e == Platform_ENFILE();
_o_result = e == Platform_EMFILE() || e == Platform_ENFILE();
return _o_result;
} }
BOOLEAN Platform_NoSuchDirectory (int16 e) BOOLEAN Platform_NoSuchDirectory (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_DifferentFilesystems (int16 e) BOOLEAN Platform_DifferentFilesystems (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EXDEV();
_o_result = e == Platform_EXDEV();
return _o_result;
} }
BOOLEAN Platform_Inaccessible (int16 e) BOOLEAN Platform_Inaccessible (int16 e)
{ {
BOOLEAN _o_result; return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
_o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
return _o_result;
} }
BOOLEAN Platform_Absent (int16 e) BOOLEAN Platform_Absent (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_TimedOut (int16 e) BOOLEAN Platform_TimedOut (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ETIMEDOUT();
_o_result = e == Platform_ETIMEDOUT();
return _o_result;
} }
BOOLEAN Platform_ConnectionFailed (int16 e) BOOLEAN Platform_ConnectionFailed (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
_o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
return _o_result;
} }
BOOLEAN Platform_Interrupted (int16 e) BOOLEAN Platform_Interrupted (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EINTR();
_o_result = e == Platform_EINTR();
return _o_result;
} }
int32 Platform_OSAllocate (int32 size) int32 Platform_OSAllocate (int32 size)
{ {
int32 _o_result; return Platform_allocate(size);
_o_result = Platform_allocate(size);
return _o_result;
} }
void Platform_OSFree (int32 address) void Platform_OSFree (int32 address)
@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr)
BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
{ {
BOOLEAN _o_result;
Platform_EnvPtr p = NIL; Platform_EnvPtr p = NIL;
__DUP(var, var__len, CHAR); __DUP(var, var__len, CHAR);
p = Platform_getenv(var, var__len); p = Platform_getenv(var, var__len);
if (p != NIL) { if (p != NIL) {
__COPY(*p, val, val__len); __COPY(*p, val, val__len);
} }
_o_result = p != NIL;
__DEL(var); __DEL(var);
return _o_result; return p != NIL;
} }
void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val)
int16 Platform_ArgPos (CHAR *s, LONGINT s__len) int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
CHAR arg[256]; CHAR arg[256];
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
i += 1; i += 1;
Platform_GetArg(i, (void*)arg, 256); Platform_GetArg(i, (void*)arg, 256);
} }
_o_result = i;
__DEL(s); __DEL(s);
return _o_result; return i;
} }
void Platform_SetInterruptHandler (Platform_SignalHandler handler) void Platform_SetInterruptHandler (Platform_SignalHandler handler)
@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
int32 Platform_Time (void) int32 Platform_Time (void)
{ {
int32 _o_result;
int32 ms; int32 ms;
Platform_gettimeval(); Platform_gettimeval();
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
} }
void Platform_Delay (int32 ms) void Platform_Delay (int32 ms)
@ -381,126 +357,100 @@ void Platform_Delay (int32 ms)
int16 Platform_System (CHAR *cmd, LONGINT cmd__len) int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{ {
int16 _o_result;
__DUP(cmd, cmd__len, CHAR); __DUP(cmd, cmd__len, CHAR);
_o_result = Platform_system(cmd, cmd__len);
__DEL(cmd); __DEL(cmd);
return _o_result; return Platform_system(cmd, cmd__len);
} }
int16 Platform_Error (void) int16 Platform_Error (void)
{ {
int16 _o_result; return Platform_err();
_o_result = Platform_err();
return _o_result;
} }
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openro(n, n__len); fd = Platform_openro(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openrw(n, n__len); fd = Platform_openrw(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_opennew(n, n__len); fd = Platform_opennew(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Close (int32 h) int16 Platform_Close (int32 h)
{ {
int16 _o_result;
if (Platform_closefile(h) < 0) { if (Platform_closefile(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
__DUP(n, n__len, CHAR); __DUP(n, n__len, CHAR);
Platform_structstats(); Platform_structstats();
if (Platform_stat(n, n__len) < 0) { if (Platform_stat(n, n__len) < 0) {
_o_result = Platform_err();
__DEL(n); __DEL(n);
return _o_result; return Platform_err();
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0;
__DEL(n); __DEL(n);
return _o_result; return 0;
} }
BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (i1.index == i2.index && i1.volume == i2.volume);
_o_result = (i1.index == i2.index && i1.volume == i2.volume);
return _o_result;
} }
BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return i1.mtime == i2.mtime;
_o_result = i1.mtime == i2.mtime;
return _o_result;
} }
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, int32 *l)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
*l = Platform_statsize(); *l = Platform_statsize();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, p, l); *n = Platform_readfile(h, p, l);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, (address)b, b__len); *n = Platform_readfile(h, (address)b, b__len);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Write (int32 h, int32 p, int32 l) int16 Platform_Write (int32 h, int32 p, int32 l)
{ {
int16 _o_result;
int32 written; int32 written;
written = Platform_writefile(h, p, l); written = Platform_writefile(h, p, l);
if (written < 0) { if (written < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Sync (int32 h) int16 Platform_Sync (int32 h)
{ {
int16 _o_result;
if (Platform_fsync(h) < 0) { if (Platform_fsync(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Seek (int32 h, int32 offset, int16 whence) int16 Platform_Seek (int32 h, int32 offset, int16 whence)
{ {
int16 _o_result;
if (Platform_lseek(h, offset, whence) < 0) { if (Platform_lseek(h, offset, whence) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Truncate (int32 h, int32 l) int16 Platform_Truncate (int32 h, int32 l)
{ {
int16 _o_result;
if (Platform_ftruncate(h, l) < 0) { if (Platform_ftruncate(h, l) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Unlink (CHAR *n, LONGINT n__len) int16 Platform_Unlink (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_unlink(n, n__len) < 0) { if (Platform_unlink(n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Chdir (CHAR *n, LONGINT n__len) int16 Platform_Chdir (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
int16 r; int16 r;
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
_o_result = 0; return 0;
return _o_result;
} else { } else {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_rename(o, o__len, n, n__len) < 0) { if (Platform_rename(o, o__len, n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i);
REAL Reals_Ten (int16 e) REAL Reals_Ten (int16 e)
{ {
REAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
LONGREAL Reals_TenL (int16 e) LONGREAL Reals_TenL (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e)
} }
e = __ASHR(e, 1); e = __ASHR(e, 1);
if (e <= 0) { if (e <= 0) {
_o_result = r; return r;
return _o_result;
} }
power = power * power; power = power * power;
} }
@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e)
int16 Reals_Expo (REAL x) int16 Reals_Expo (REAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 2, i, int16); __GET((address)&x + 2, i, int16);
_o_result = __MASK(__ASHR(i, 7), -256); return __MASK(__ASHR(i, 7), -256);
return _o_result;
} }
void Reals_SetExpo (REAL *x, int16 ex) void Reals_SetExpo (REAL *x, int16 ex)
@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex)
int16 Reals_ExpoL (LONGREAL x) int16 Reals_ExpoL (LONGREAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 6, i, int16); __GET((address)&x + 6, i, int16);
_o_result = __MASK(__ASHR(i, 4), -2048); return __MASK(__ASHR(i, 4), -2048);
return _o_result;
} }
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
static CHAR Reals_ToHex (int16 i) static CHAR Reals_ToHex (int16 i)
{ {
CHAR _o_result;
if (i < 10) { if (i < 10) {
_o_result = (CHAR)(i + 48); return (CHAR)(i + 48);
return _o_result;
} else { } else {
_o_result = (CHAR)(i + 55); return (CHAR)(i + 55);
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR
int16 Strings_Length (CHAR *s, LONGINT s__len) int16 Strings_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int32 i; int32 i;
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
i = 0; i = 0;
@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
i += 1; i += 1;
} }
if (i <= 32767) { if (i <= 32767) {
_o_result = (int16)i;
__DEL(s); __DEL(s);
return _o_result; return (int16)i;
} else { } else {
_o_result = 32767;
__DEL(s); __DEL(s);
return _o_result; return 32767;
} }
__RETCHK; __RETCHK;
} }
@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
} }
if (pos > n1) { if (pos > n1) {
Strings_Append(dest, dest__len, (void*)source, source__len); Strings_Append(dest, dest__len, (void*)source, source__len);
__DEL(source);
return; return;
} }
if ((pos + n2) < dest__len) { if ((pos + n2) < dest__len) {
@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
} }
if (pos >= len) { if (pos >= len) {
dest[0] = 0x00; dest[0] = 0x00;
__DEL(source);
return; return;
} }
i = 0; i = 0;
@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
{ {
int16 _o_result;
int16 n1, n2, i, j; int16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len); n1 = Strings_Length(s, s__len);
n2 = Strings_Length(pattern, pattern__len); n2 = Strings_Length(pattern, pattern__len);
if (n2 == 0) { if (n2 == 0) {
_o_result = 0;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return 0;
} }
i = pos; i = pos;
while (i <= n1 - n2) { while (i <= n1 - n2) {
@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
j += 1; j += 1;
} }
if (j == n2) { if (j == n2) {
_o_result = i;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return i;
} }
} }
i += 1; i += 1;
} }
_o_result = -1;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return -1;
} }
void Strings_Cap (CHAR *s, LONGINT s__len) void Strings_Cap (CHAR *s, LONGINT s__len)
@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
{ {
BOOLEAN _o_result;
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {
_o_result = 0; return 0;
return _o_result;
} }
n -= 1; n -= 1;
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = n < 0; return n < 0;
return _o_result;
} }
while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { while ((m >= 0 && mask[__X(m, mask__len)] == '*')) {
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = 1; return 1;
return _o_result;
} }
while (n >= 0) { while (n >= 0) {
if (M__8(name, name__len, mask, mask__len, n, m)) { if (M__8(name, name__len, mask, mask__len, n, m)) {
_o_result = 1; return 1;
return _o_result;
} }
n -= 1; n -= 1;
} }
_o_result = 0; return 0;
return _o_result;
} }
BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len)
{ {
BOOLEAN _o_result;
struct Match__7 _s; struct Match__7 _s;
__DUP(string, string__len, CHAR); __DUP(string, string__len, CHAR);
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
_s.lnk = Match__7_s; _s.lnk = Match__7_s;
Match__7_s = &_s; Match__7_s = &_s;
_o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
Match__7_s = _s.lnk; Match__7_s = _s.lnk;
__DEL(string); __DEL(string);
__DEL(pattern); __DEL(pattern);
return _o_result; return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
} }

View file

@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
{ {
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL; Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc); __NEW(F, Texts_FontDesc);
__COPY(name, F->name, 32); __COPY(name, F->name, 32);
_o_result = F; return F;
return _o_result;
} }
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas
static Texts_Piece Texts_ClonePiece (Texts_Piece p) static Texts_Piece Texts_ClonePiece (Texts_Piece p)
{ {
Texts_Piece _o_result;
Texts_Piece q = NIL; Texts_Piece q = NIL;
__NEW(q, Texts_PieceDesc); __NEW(q, Texts_PieceDesc);
__GUARDEQP(q, Texts_PieceDesc) = *p; __GUARDEQP(q, Texts_PieceDesc) = *p;
_o_result = q; return q;
return _o_result;
} }
static Texts_Elem Texts_CloneElem (Texts_Elem e) static Texts_Elem Texts_CloneElem (Texts_Elem e)
{ {
Texts_Elem _o_result;
Texts_CopyMsg msg; Texts_CopyMsg msg;
msg.e = NIL; msg.e = NIL;
(*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ);
_o_result = msg.e; return msg.e;
return _o_result;
} }
void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
Texts_Text Texts_ElemBase (Texts_Elem E) Texts_Text Texts_ElemBase (Texts_Elem E)
{ {
Texts_Text _o_result; return E->base;
_o_result = E->base;
return _o_result;
} }
int32 Texts_ElemPos (Texts_Elem E) int32 Texts_ElemPos (Texts_Elem E)
{ {
int32 _o_result;
Texts_Run u = NIL; Texts_Run u = NIL;
int32 pos; int32 pos;
u = E->base->head->next; u = E->base->head->next;
@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E)
pos = pos + u->len; pos = pos + u->len;
u = u->next; u = u->next;
} }
_o_result = pos; return pos;
return _o_result;
} }
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
int32 Texts_Pos (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ)
{ {
int32 _o_result; return (*R).org + (*R).off;
_o_result = (*R).org + (*R).off;
return _o_result;
} }
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)

View file

@ -317,14 +317,11 @@ void Files_Close (Files_File f)
int32 Files_Length (Files_File f) int32 Files_Length (Files_File f)
{ {
int32 _o_result; return f->len;
_o_result = f->len;
return _o_result;
} }
Files_File Files_New (CHAR *name, LONGINT name__len) Files_File Files_New (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
f->len = 0; f->len = 0;
f->pos = 0; f->pos = 0;
f->swapper = -1; f->swapper = -1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
CHAR ch; CHAR ch;
i = 0; i = 0;
@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
i += 1; i += 1;
ch = name[i]; ch = name[i];
} }
_o_result = ch == '/'; return ch == '/';
return _o_result;
} }
static Files_File Files_CacheEntry (Platform_FileIdentity identity) static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int16 i, error; int16 i, error;
f = Files_files; f = Files_files;
@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
f->identity = identity; f->identity = identity;
error = Platform_Size(f->fd, &f->len); error = Platform_Size(f->fd, &f->len);
} }
_o_result = f; return f;
return _o_result;
} }
f = f->next; f = f->next;
} }
_o_result = NIL; return NIL;
return _o_result;
} }
Files_File Files_Old (CHAR *name, LONGINT name__len) Files_File Files_Old (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int32 fd; int32 fd;
int16 pos; int16 pos;
@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
f = Files_CacheEntry(identity); f = Files_CacheEntry(identity);
if (f != NIL) { if (f != NIL) {
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} else { } else {
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
Heap_RegisterFinalizer((void*)f, Files_Finalize); Heap_RegisterFinalizer((void*)f, Files_Finalize);
@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->next = Files_files; f->next = Files_files;
Files_files = f; Files_files = f;
Heap_FileCount += 1; Heap_FileCount += 1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
} else if (dir[0] == 0x00) { } else if (dir[0] == 0x00) {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} else { } else {
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256); Files_ScanPath(&pos, (void*)dir, 256);
} }
} }
} else { } else {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }
@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d)
int32 Files_Pos (Files_Rider *r, address *r__typ) int32 Files_Pos (Files_Rider *r, address *r__typ)
{ {
int32 _o_result; return (*r).org + (*r).offset;
_o_result = (*r).org + (*r).offset;
return _o_result;
} }
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
Files_File Files_Base (Files_Rider *r, address *r__typ) Files_File Files_Base (Files_Rider *r, address *r__typ)
{ {
Files_File _o_result; return (*r).buf->f;
_o_result = (*r).buf->f;
return _o_result;
} }
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
error = Platform_Rename((void*)old, old__len, (void*)new, new__len); error = Platform_Rename((void*)old, old__len, (void*)new, new__len);
if (!Platform_DifferentFilesystems(error)) { if (!Platform_DifferentFilesystems(error)) {
*res = error; *res = error;
__DEL(old);
__DEL(new);
return; return;
} else { } else {
error = Platform_OldRO((void*)old, old__len, &fdold); error = Platform_OldRO((void*)old, old__len, &fdold);
if (error != 0) { if (error != 0) {
*res = 2; *res = 2;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_New((void*)new, new__len, &fdnew); error = Platform_New((void*)new, new__len, &fdnew);
if (error != 0) { if (error != 0) {
error = Platform_Close(fdold); error = Platform_Close(fdold);
*res = 3; *res = 3;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_Read(fdold, (address)buf, 4096, &n); error = Platform_Read(fdold, (address)buf, 4096, &n);

View file

@ -127,7 +127,6 @@ void Heap_Unlock (void)
SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
{ {
SYSTEM_PTR _o_result;
Heap_Module m; Heap_Module m;
if (__STRCMP(name, "Heap") == 0) { if (__STRCMP(name, "Heap") == 0) {
__SYSNEW(m, 64); __SYSNEW(m, 64);
@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
m->enumPtrs = enumPtrs; m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(address)Heap_modules; m->next = (Heap_Module)(address)Heap_modules;
Heap_modules = (SYSTEM_PTR)m; Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m; return (void*)m;
return _o_result;
} }
void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m)
static int64 Heap_NewChunk (int64 blksz) static int64 Heap_NewChunk (int64 blksz)
{ {
int64 _o_result;
int64 chnk; int64 chnk;
chnk = Heap_OSAllocate(blksz + 24); chnk = Heap_OSAllocate(blksz + 24);
if (chnk != 0) { if (chnk != 0) {
@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz)
Heap_bigBlocks = chnk + 24; Heap_bigBlocks = chnk + 24;
Heap_heapsize += blksz; Heap_heapsize += blksz;
} }
_o_result = chnk; return chnk;
return _o_result;
} }
static void Heap_ExtendHeap (int64 blksz) static void Heap_ExtendHeap (int64 blksz)
@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz)
SYSTEM_PTR Heap_NEWREC (int64 tag) SYSTEM_PTR Heap_NEWREC (int64 tag)
{ {
SYSTEM_PTR _o_result;
int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
new = Heap_NEWREC(tag); new = Heap_NEWREC(tag);
} }
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} else { } else {
Heap_Unlock(); Heap_Unlock();
_o_result = NIL; return NIL;
return _o_result;
} }
} }
__GET(adr + 8, t, int64); __GET(adr + 8, t, int64);
@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
__PUT(adr + 16, 0, int64); __PUT(adr + 16, 0, int64);
Heap_allocated += blksz; Heap_allocated += blksz;
Heap_Unlock(); Heap_Unlock();
_o_result = (SYSTEM_PTR)(address)(adr + 8); return (SYSTEM_PTR)(address)(adr + 8);
return _o_result;
} }
SYSTEM_PTR Heap_NEWBLK (int64 size) SYSTEM_PTR Heap_NEWBLK (int64 size)
{ {
SYSTEM_PTR _o_result;
int64 blksz, tag; int64 blksz, tag;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size)
__PUT(tag + 8, -8, int64); __PUT(tag + 8, -8, int64);
__PUT((int64)(address)new - 8, tag, int64); __PUT((int64)(address)new - 8, tag, int64);
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} }
static void Heap_Mark (int64 q) static void Heap_Mark (int64 q)

View file

@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
{ {
Modules_Module _o_result;
Modules_Module m = NIL; Modules_Module m = NIL;
CHAR bodyname[64]; CHAR bodyname[64];
Modules_Command body; Modules_Command body;
@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
} }
_o_result = m;
__DEL(name); __DEL(name);
return _o_result; return m;
} }
Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len)
{ {
Modules_Command _o_result;
Modules_Cmd c = NIL; Modules_Cmd c = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
c = mod->cmds; c = mod->cmds;
@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
if (c != NIL) { if (c != NIL) {
Modules_res = 0; Modules_res = 0;
Modules_resMsg[0] = 0x00; Modules_resMsg[0] = 0x00;
_o_result = c->cmd;
__DEL(name); __DEL(name);
return _o_result; return c->cmd;
} else { } else {
Modules_res = 2; Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11); __MOVE(" command \"", Modules_resMsg, 11);
@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }

View file

@ -74,7 +74,6 @@ static void OPB_err (int16 n)
OPT_Node OPB_NewLeaf (OPT_Object obj) OPT_Node OPB_NewLeaf (OPT_Object obj)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
switch (obj->mode) { switch (obj->mode) {
case 1: case 1:
@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
} }
node->obj = obj; node->obj = obj;
node->typ = obj->typ; node->typ = obj->typ;
_o_result = node; return node;
return _o_result;
} }
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
static int16 OPB_BoolToInt (BOOLEAN b) static int16 OPB_BoolToInt (BOOLEAN b)
{ {
int16 _o_result;
if (b) { if (b) {
_o_result = 1; return 1;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
static BOOLEAN OPB_IntToBool (int64 i) static BOOLEAN OPB_IntToBool (int64 i)
{ {
BOOLEAN _o_result; return i != 0;
_o_result = i != 0;
return _o_result;
} }
OPT_Node OPB_NewBoolConst (BOOLEAN boolval) OPT_Node OPB_NewBoolConst (BOOLEAN boolval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_booltyp; x->typ = OPT_booltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = OPB_BoolToInt(boolval); x->conval->intval = OPB_BoolToInt(boolval);
_o_result = x; return x;
return _o_result;
} }
void OPB_OptIf (OPT_Node *x) void OPB_OptIf (OPT_Node *x)
@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x)
OPT_Node OPB_Nil (void) OPT_Node OPB_Nil (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_niltyp; x->typ = OPT_niltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = 0; x->conval->intval = 0;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_EmptySet (void) OPT_Node OPB_EmptySet (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_settyp; x->typ = OPT_settyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->setval = 0x0; x->conval->setval = 0x0;
_o_result = x; return x;
return _o_result;
} }
static void OPB_SetIntType (OPT_Node node) static void OPB_SetIntType (OPT_Node node)
@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node)
OPT_Node OPB_NewIntConst (int64 intval) OPT_Node OPB_NewIntConst (int64 intval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = intval; x->conval->intval = intval;
OPB_SetIntType(x); OPB_SetIntType(x);
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->realval = realval; x->conval->realval = realval;
x->typ = typ; x->typ = typ;
x->conval->intval = -1; x->conval->intval = -1;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewString (OPS_String str, int64 len) OPT_Node OPB_NewString (OPS_String str, int64 len)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len)
x->conval->intval2 = OPM_Longint(len); x->conval->intval2 = OPM_Longint(len);
x->conval->ext = OPT_NewExt(); x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, 256); __COPY(str, *x->conval->ext, 256);
_o_result = x; return x;
return _o_result;
} }
static void OPB_CharToString (OPT_Node n) static void OPB_CharToString (OPT_Node n)
@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN OPB_NotVar (OPT_Node x) static BOOLEAN OPB_NotVar (OPT_Node x)
{ {
BOOLEAN _o_result; return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
_o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
return _o_result;
} }
void OPB_DeRef (OPT_Node *x) void OPB_DeRef (OPT_Node *x)
@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y)
static int64 OPB_log (int64 x) static int64 OPB_log (int64 x)
{ {
int64 _o_result;
OPB_exp = 0; OPB_exp = 0;
if (x > 0) { if (x > 0) {
while (!__ODD(x)) { while (!__ODD(x)) {
@ -497,8 +475,7 @@ static int64 OPB_log (int64 x)
OPB_exp += 1; OPB_exp += 1;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(11); node = OPT_NewNode(11);
node->subcl = op; node->subcl = op;
node->typ = typ; node->typ = typ;
node->left = z; node->left = z;
_o_result = node; return node;
return _o_result;
} }
void OPB_MOp (int8 op, OPT_Node *x) void OPB_MOp (int8 op, OPT_Node *x)
@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void) static int16 ConstCmp__14 (void)
{ {
int16 _o_result;
int16 res; int16 res;
switch (*ConstOp__13_s->f) { switch (*ConstOp__13_s->f) {
case 0: case 0:
@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void)
break; break;
} }
(*ConstOp__13_s->x)->typ = OPT_booltyp; (*ConstOp__13_s->x)->typ = OPT_booltyp;
_o_result = res; return res;
return _o_result;
} }
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
{ {
BOOLEAN _o_result;
BOOLEAN ok, xCharArr, yCharArr; BOOLEAN ok, xCharArr, yCharArr;
xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8;
yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8;
@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
OPB_Index(&*x, OPB_NewIntConst(0)); OPB_Index(&*x, OPB_NewIntConst(0));
} }
} }
_o_result = ok; return ok;
return _o_result;
} }
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(class); node = OPT_NewNode(class);
node->subcl = subcl; node->subcl = subcl;
node->left = left; node->left = left;
node->right = right; node->right = right;
_o_result = node; return node;
return _o_result;
} }
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)

View file

@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static int16 OPC_Length (CHAR *s, LONGINT s__len) static int16 OPC_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
i = 0; i = 0;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
i += 1; i += 1;
} }
_o_result = i; return i;
return _o_result;
} }
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i, h; int16 i, h;
i = 0; i = 0;
h = 0; h = 0;
@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
h = 3 * h + (int16)s[__X(i, s__len)]; h = 3 * h + (int16)s[__X(i, s__len)];
i += 1; i += 1;
} }
_o_result = (int)__MOD(h, 105); return (int)__MOD(h, 105);
return _o_result;
} }
void OPC_Ident (OPT_Object obj) void OPC_Ident (OPT_Object obj)
@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
_o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result;
} }
static void OPC_DeclareBase (OPT_Object dcl) static void OPC_DeclareBase (OPT_Object dcl)
@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
int32 OPC_NofPtrs (OPT_Struct typ) int32 OPC_NofPtrs (OPT_Struct typ)
{ {
int32 _o_result;
OPT_Object fld = NIL; OPT_Object fld = NIL;
OPT_Struct btyp = NIL; OPT_Struct btyp = NIL;
int32 n; int32 n;
if ((typ->form == 11 && typ->sysflag == 0)) { if ((typ->form == 11 && typ->sysflag == 0)) {
_o_result = 1; return 1;
return _o_result;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp != NIL) { if (btyp != NIL) {
@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ)
} }
fld = fld->link; fld = fld->link;
} }
_o_result = n; return n;
return _o_result;
} else if (typ->comp == 2) { } else if (typ->comp == 2) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
n = typ->n; n = typ->n;
@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ)
n = btyp->n * n; n = btyp->n * n;
btyp = btyp->BaseTyp; btyp = btyp->BaseTyp;
} }
_o_result = OPC_NofPtrs(btyp) * n; return OPC_NofPtrs(btyp) * n;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Object OPC_BaseTProc (OPT_Object obj)
{ {
OPT_Object _o_result;
OPT_Struct typ = NIL, base = NIL; OPT_Struct typ = NIL, base = NIL;
int32 mno; int32 mno;
typ = obj->link->typ; typ = obj->link->typ;
@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj)
base = typ->BaseTyp; base = typ->BaseTyp;
} }
OPT_FindField(obj->name, typ, &obj); OPT_FindField(obj->name, typ, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
BOOLEAN r;
__DUP(y, y__len, CHAR); __DUP(y, y__len, CHAR);
i = 0; i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
i += 1; i += 1;
} }
r = y[__X(i, y__len)] == 0x00;
_o_result = r;
__DEL(y); __DEL(y);
return _o_result; return y[__X(i, y__len)] == 0x00;
} }
static void OPC_CProcDefs (OPT_Object obj, int16 vis) static void OPC_CProcDefs (OPT_Object obj, int16 vis)
@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc)
} }
OPC_ProcHeader(proc, 1); OPC_ProcHeader(proc, 1);
OPC_BegBlk(); OPC_BegBlk();
if (proc->typ != OPT_notyp) {
OPC_BegStat();
OPC_Ident(proc->typ->strobj);
OPM_WriteString((CHAR*)" _o_result;", 12);
OPM_WriteLn();
}
scope = proc->scope; scope = proc->scope;
OPC_IdentList(scope->scope, 0); OPC_IdentList(scope->scope, 0);
if (!scope->leaf) { if (!scope->leaf) {

View file

@ -124,33 +124,25 @@ void OPM_LogWLn (void)
int64 OPM_SignedMaximum (int32 bytecount) int64 OPM_SignedMaximum (int32 bytecount)
{ {
int64 _o_result;
int64 result; int64 result;
result = 1; result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
_o_result = result - 1; return result - 1;
return _o_result;
} }
int64 OPM_SignedMinimum (int32 bytecount) int64 OPM_SignedMinimum (int32 bytecount)
{ {
int64 _o_result; return -OPM_SignedMaximum(bytecount) - 1;
_o_result = -OPM_SignedMaximum(bytecount) - 1;
return _o_result;
} }
int32 OPM_Longint (int64 n) int32 OPM_Longint (int64 n)
{ {
int32 _o_result; return __VAL(int32, n);
_o_result = __VAL(int32, n);
return _o_result;
} }
int16 OPM_Integer (int64 n) int16 OPM_Integer (int64 n)
{ {
int16 _o_result; return __VAL(int16, n);
_o_result = __VAL(int16, n);
return _o_result;
} }
static void OPM_ScanOptions (CHAR *s, LONGINT s__len) static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
BOOLEAN OPM_OpenPar (void) BOOLEAN OPM_OpenPar (void)
{ {
BOOLEAN _o_result;
CHAR s[256]; CHAR s[256];
if (Platform_ArgCount == 1) { if (Platform_ArgCount == 1) {
OPM_LogWLn(); OPM_LogWLn();
@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr(Configuration_versionLong, 75); OPM_LogWStr(Configuration_versionLong, 75);
OPM_LogW('.'); OPM_LogW('.');
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68);
OPM_LogWLn(); OPM_LogWLn();
@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWStr((CHAR*)"Options:", 9);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWStr((CHAR*)" Run time safety", 18);
@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58);
@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn(); OPM_LogWLn();
_o_result = 0; return 0;
return _o_result;
} else { } else {
OPM_AddressSize = 8; OPM_AddressSize = 8;
OPM_GetAlignment(&OPM_Alignment); OPM_GetAlignment(&OPM_Alignment);
@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_GlobalAlignment = OPM_Alignment; OPM_GlobalAlignment = OPM_Alignment;
__COPY(OPM_Model, OPM_GlobalModel, 10); __COPY(OPM_Model, OPM_GlobalModel, 10);
OPM_GlobalOptions = OPM_Options; OPM_GlobalOptions = OPM_Options;
_o_result = 1; return 1;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch)
int32 OPM_SymRInt (void) int32 OPM_SymRInt (void)
{ {
int32 _o_result;
int32 k; int32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
_o_result = k; return k;
return _o_result;
} }
int64 OPM_SymRInt64 (void) int64 OPM_SymRInt64 (void)
{ {
int64 _o_result;
int64 k; int64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
_o_result = k; return k;
return _o_result;
} }
void OPM_SymRSet (uint64 *s) void OPM_SymRSet (uint64 *s)
@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
BOOLEAN OPM_eofSF (void) BOOLEAN OPM_eofSF (void)
{ {
BOOLEAN _o_result; return OPM_oldSF.eof;
_o_result = OPM_oldSF.eof;
return _o_result;
} }
void OPM_SymWCh (CHAR ch) void OPM_SymWCh (CHAR ch)

View file

@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
{ {
BOOLEAN _o_result;
if ((b->form == 11 && x->form == 11)) { if ((b->form == 11 && x->form == 11)) {
b = b->BaseTyp; b = b->BaseTyp;
x = x->BaseTyp; x = x->BaseTyp;
@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
x = x->BaseTyp; x = x->BaseTyp;
} while (!(x == NIL || x == b)); } while (!(x == NIL || x == b));
} }
_o_result = x == b; return x == b;
return _o_result;
} }
static struct ProcedureDeclaration__16 { static struct ProcedureDeclaration__16 {

View file

@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e);
static LONGREAL Ten__9 (int16 e) static LONGREAL Ten__9 (int16 e)
{ {
LONGREAL _o_result;
LONGREAL x, p; LONGREAL x, p;
x = (LONGREAL)1; x = (LONGREAL)1;
p = (LONGREAL)10; p = (LONGREAL)10;
@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e)
p = p * p; p = p * p;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static int16 Ord__7 (CHAR ch, BOOLEAN hex) static int16 Ord__7 (CHAR ch, BOOLEAN hex)
{ {
int16 _o_result;
if (ch <= '9') { if (ch <= '9') {
_o_result = (int16)ch - 48; return (int16)ch - 48;
return _o_result;
} else if (hex) { } else if (hex) {
_o_result = ((int16)ch - 65) + 10; return ((int16)ch - 65) + 10;
return _o_result;
} else { } else {
OPS_err(2); OPS_err(2);
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -324,6 +318,7 @@ void OPS_Get (int8 *sym)
while (OPS_ch <= ' ') { while (OPS_ch <= ' ') {
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
*sym = 64; *sym = 64;
Get__1_s = _s.lnk;
return; return;
} else { } else {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);

View file

@ -179,7 +179,6 @@ static void OPT_err (int16 n)
int16 OPT_IntSize (int64 n) int16 OPT_IntSize (int64 n)
{ {
int16 _o_result;
int16 bytes; int16 bytes;
if (n < 0) { if (n < 0) {
n = -(n + 1); n = -(n + 1);
@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n)
while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) {
bytes += 1; bytes += 1;
} }
_o_result = bytes; return bytes;
return _o_result;
} }
OPT_Struct OPT_IntType (int32 size) OPT_Struct OPT_IntType (int32 size)
{ {
OPT_Struct _o_result;
if (size <= OPT_int8typ->size) { if (size <= OPT_int8typ->size) {
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
if (size <= OPT_int16typ->size) { if (size <= OPT_int16typ->size) {
_o_result = OPT_int16typ; return OPT_int16typ;
return _o_result;
} }
if (size <= OPT_int32typ->size) { if (size <= OPT_int32typ->size) {
_o_result = OPT_int32typ; return OPT_int32typ;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} }
OPT_Struct OPT_SetType (int32 size) OPT_Struct OPT_SetType (int32 size)
{ {
OPT_Struct _o_result;
if (size == OPT_set32typ->size) { if (size == OPT_set32typ->size) {
_o_result = OPT_set32typ; return OPT_set32typ;
return _o_result;
} }
_o_result = OPT_set64typ; return OPT_set64typ;
return _o_result;
} }
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
{ {
OPT_Struct _o_result;
int16 i; int16 i;
__ASSERT(x->form == 4, 0); __ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0); __ASSERT(dir == 1 || dir == -1, 0);
if (dir > 0) { if (dir > 0) {
if (x->size < OPT_sinttyp->size) { if (x->size < OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
if (x->size < OPT_inttyp->size) { if (x->size < OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size < OPT_linttyp->size) { if (x->size < OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} else { } else {
if (x->size > OPT_linttyp->size) { if (x->size > OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
if (x->size > OPT_inttyp->size) { if (x->size > OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size > OPT_sinttyp->size) { if (x->size > OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base)
int32 OPT_SizeAlignment (int32 size) int32 OPT_SizeAlignment (int32 size)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (size < OPM_Alignment) { if (size < OPM_Alignment) {
alignment = 1; alignment = 1;
@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size)
} else { } else {
alignment = OPM_Alignment; alignment = OPM_Alignment;
} }
_o_result = alignment; return alignment;
return _o_result;
} }
int32 OPT_BaseAlignment (OPT_Struct typ) int32 OPT_BaseAlignment (OPT_Struct typ)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (typ->form == 13) { if (typ->form == 13) {
if (typ->comp == 4) { if (typ->comp == 4) {
@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
} else { } else {
alignment = OPT_SizeAlignment(typ->size); alignment = OPT_SizeAlignment(typ->size);
} }
_o_result = alignment; return alignment;
return _o_result;
} }
void OPT_TypSize (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ)
@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ)
OPT_Const OPT_NewConst (void) OPT_Const OPT_NewConst (void)
{ {
OPT_Const _o_result;
OPT_Const const_ = NIL; OPT_Const const_ = NIL;
__NEW(const_, OPT_ConstDesc); __NEW(const_, OPT_ConstDesc);
_o_result = const_; return const_;
return _o_result;
} }
OPT_Object OPT_NewObj (void) OPT_Object OPT_NewObj (void)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
__NEW(obj, OPT_ObjDesc); __NEW(obj, OPT_ObjDesc);
_o_result = obj; return obj;
return _o_result;
} }
OPT_Struct OPT_NewStr (int8 form, int8 comp) OPT_Struct OPT_NewStr (int8 form, int8 comp)
{ {
OPT_Struct _o_result;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc); __NEW(typ, OPT_StrDesc);
typ->form = form; typ->form = form;
@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
} }
typ->size = -1; typ->size = -1;
typ->BaseTyp = OPT_undftyp; typ->BaseTyp = OPT_undftyp;
_o_result = typ; return typ;
return _o_result;
} }
OPT_Node OPT_NewNode (int8 class) OPT_Node OPT_NewNode (int8 class)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc); __NEW(node, OPT_NodeDesc);
node->class = class; node->class = class;
_o_result = node; return node;
return _o_result;
} }
OPT_ConstExt OPT_NewExt (void) OPT_ConstExt OPT_NewExt (void)
{ {
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL; OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256)));
_o_result = ext; return ext;
return _o_result;
} }
void OPT_OpenScope (int8 level, OPT_Object owner) void OPT_OpenScope (int8 level, OPT_Object owner)
@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void) static OPT_Object OPT_InFld (void)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void)
obj->vis = 0; obj->vis = 0;
obj->adr = OPM_SymRInt(); obj->adr = OPM_SymRInt();
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Object OPT_InTProc (int8 mno) static OPT_Object OPT_InTProc (int8 mno)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno)
obj->vis = 0; obj->vis = 0;
obj->adr = __ASHL(OPM_SymRInt(), 16); obj->adr = __ASHL(OPM_SymRInt(), 16);
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Struct OPT_InTyp (int32 tag) static OPT_Struct OPT_InTyp (int32 tag)
{ {
OPT_Struct _o_result;
if (tag == 4) { if (tag == 4) {
_o_result = OPT_IntType(OPM_SymRInt()); return OPT_IntType(OPM_SymRInt());
return _o_result;
} else if (tag == 7) { } else if (tag == 7) {
_o_result = OPT_SetType(OPM_SymRInt()); return OPT_SetType(OPM_SymRInt());
return _o_result;
} else { } else {
_o_result = OPT_impCtxt.ref[__X(tag, 255)]; return OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ)
static OPT_Object OPT_InObj (int8 mno) static OPT_Object OPT_InObj (int8 mno)
{ {
OPT_Object _o_result;
int16 i, s; int16 i, s;
CHAR ch; CHAR ch;
OPT_Object obj = NIL, old = NIL; OPT_Object obj = NIL, old = NIL;
@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno)
} }
} }
} }
_o_result = obj; return obj;
return _o_result;
} }
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)

View file

@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope)
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
{ {
int16 _o_result;
switch (class) { switch (class) {
case 7: case 0: case 2: case 4: case 9: case 7: case 0: case 2: case 4: case 9:
case 13: case 13:
_o_result = 10; return 10;
return _o_result;
break; break;
case 5: case 5:
if (__IN(3, OPM_Options, 32)) { if (__IN(3, OPM_Options, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 1: case 1:
if (__IN(comp, 0x0c, 32)) { if (__IN(comp, 0x0c, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 3: case 3:
_o_result = 9; return 9;
return _o_result;
break; break;
case 11: case 11:
switch (subclass) { switch (subclass) {
case 33: case 7: case 24: case 29: case 20: case 33: case 7: case 24: case 29: case 20:
_o_result = 9; return 9;
return _o_result;
break; break;
case 16: case 21: case 22: case 23: case 25: case 16: case 21: case 22: case 23: case 25:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55);
@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
switch (subclass) { switch (subclass) {
case 1: case 1:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 2: case 2:
if (form == 7) { if (form == 7) {
_o_result = 3; return 3;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 3: case 4: case 3: case 4:
_o_result = 10; return 10;
return _o_result;
break; break;
case 6: case 6:
if (form == 7) { if (form == 7) {
_o_result = 2; return 2;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 7: case 7:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 11: case 12: case 13: case 14: case 11: case 12: case 13: case 14:
_o_result = 6; return 6;
return _o_result;
break; break;
case 9: case 10: case 9: case 10:
_o_result = 5; return 5;
return _o_result;
break; break;
case 5: case 5:
_o_result = 1; return 1;
return _o_result;
break; break;
case 8: case 8:
_o_result = 0; return 0;
return _o_result;
break; break;
case 19: case 15: case 17: case 18: case 26: case 19: case 15: case 17: case 18: case 26:
case 27: case 28: case 27: case 28:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55);
@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
} }
break; break;
case 10: case 10:
_o_result = 10; return 10;
return _o_result;
break; break;
case 8: case 6: case 8: case 6:
_o_result = 12; return 12;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43);
@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim)
static BOOLEAN OPV_SideEffects (OPT_Node n) static BOOLEAN OPV_SideEffects (OPT_Node n)
{ {
BOOLEAN _o_result;
if (n != NIL) { if (n != NIL) {
_o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right);
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
static OPT_Object OPV_SuperProc (OPT_Node n) static OPT_Object OPV_SuperProc (OPT_Node n)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
typ = n->right->typ; typ = n->right->typ;
@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }
OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPV_expr (OPT_Node n, int16 prec) static void OPV_expr (OPT_Node n, int16 prec)
@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
{ {
BOOLEAN _o_result;
while ((n != NIL && n->class != 26)) { while ((n != NIL && n->class != 26)) {
n = n->link; n = n->link;
} }
_o_result = n == NIL; return n == NIL;
return _o_result;
} }
static void OPV_NewArr (OPT_Node d, OPT_Node x) static void OPV_NewArr (OPT_Node d, OPT_Node x)
@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
OPM_WriteString((CHAR*)"__ENDMOD", 9); OPM_WriteString((CHAR*)"__ENDMOD", 9);
} }
} else { } else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);
if (n->left != NIL) { if (n->left != NIL) {
OPM_WriteString((CHAR*)"_o_result = ", 13); OPM_Write(' ');
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8); OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10); OPV_expr(n->left, 10);
} else { } else {
OPV_expr(n->left, -1); OPV_expr(n->left, -1);
} }
OPM_WriteString((CHAR*)";", 2);
OPM_WriteLn();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return _o_result", 17);
} else {
OPM_WriteString((CHAR*)"return", 7);
} }
} }
break; break;

View file

@ -56,14 +56,12 @@ void Out_Char (CHAR ch)
static int32 Out_Length (CHAR *s, LONGINT s__len) static int32 Out_Length (CHAR *s, LONGINT s__len)
{ {
int32 _o_result;
int32 l; int32 l;
l = 0; l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) { while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1; l += 1;
} }
_o_result = l; return l;
return _o_result;
} }
void Out_String (CHAR *str, LONGINT str__len) void Out_String (CHAR *str, LONGINT str__len)
@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
LONGREAL Out_Ten (int16 e) LONGREAL Out_Ten (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)

View file

@ -174,65 +174,47 @@ extern void Heap_InitHeap();
BOOLEAN Platform_TooManyFiles (int16 e) BOOLEAN Platform_TooManyFiles (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EMFILE() || e == Platform_ENFILE();
_o_result = e == Platform_EMFILE() || e == Platform_ENFILE();
return _o_result;
} }
BOOLEAN Platform_NoSuchDirectory (int16 e) BOOLEAN Platform_NoSuchDirectory (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_DifferentFilesystems (int16 e) BOOLEAN Platform_DifferentFilesystems (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EXDEV();
_o_result = e == Platform_EXDEV();
return _o_result;
} }
BOOLEAN Platform_Inaccessible (int16 e) BOOLEAN Platform_Inaccessible (int16 e)
{ {
BOOLEAN _o_result; return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
_o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
return _o_result;
} }
BOOLEAN Platform_Absent (int16 e) BOOLEAN Platform_Absent (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ENOENT();
_o_result = e == Platform_ENOENT();
return _o_result;
} }
BOOLEAN Platform_TimedOut (int16 e) BOOLEAN Platform_TimedOut (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ETIMEDOUT();
_o_result = e == Platform_ETIMEDOUT();
return _o_result;
} }
BOOLEAN Platform_ConnectionFailed (int16 e) BOOLEAN Platform_ConnectionFailed (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
_o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
return _o_result;
} }
BOOLEAN Platform_Interrupted (int16 e) BOOLEAN Platform_Interrupted (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EINTR();
_o_result = e == Platform_EINTR();
return _o_result;
} }
int64 Platform_OSAllocate (int64 size) int64 Platform_OSAllocate (int64 size)
{ {
int64 _o_result; return Platform_allocate(size);
_o_result = Platform_allocate(size);
return _o_result;
} }
void Platform_OSFree (int64 address) void Platform_OSFree (int64 address)
@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int64 argvadr)
BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
{ {
BOOLEAN _o_result;
Platform_EnvPtr p = NIL; Platform_EnvPtr p = NIL;
__DUP(var, var__len, CHAR); __DUP(var, var__len, CHAR);
p = Platform_getenv(var, var__len); p = Platform_getenv(var, var__len);
if (p != NIL) { if (p != NIL) {
__COPY(*p, val, val__len); __COPY(*p, val, val__len);
} }
_o_result = p != NIL;
__DEL(var); __DEL(var);
return _o_result; return p != NIL;
} }
void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val)
int16 Platform_ArgPos (CHAR *s, LONGINT s__len) int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
CHAR arg[256]; CHAR arg[256];
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
i += 1; i += 1;
Platform_GetArg(i, (void*)arg, 256); Platform_GetArg(i, (void*)arg, 256);
} }
_o_result = i;
__DEL(s); __DEL(s);
return _o_result; return i;
} }
void Platform_SetInterruptHandler (Platform_SignalHandler handler) void Platform_SetInterruptHandler (Platform_SignalHandler handler)
@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
int32 Platform_Time (void) int32 Platform_Time (void)
{ {
int32 _o_result;
int32 ms; int32 ms;
Platform_gettimeval(); Platform_gettimeval();
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
} }
void Platform_Delay (int32 ms) void Platform_Delay (int32 ms)
@ -381,126 +357,100 @@ void Platform_Delay (int32 ms)
int16 Platform_System (CHAR *cmd, LONGINT cmd__len) int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{ {
int16 _o_result;
__DUP(cmd, cmd__len, CHAR); __DUP(cmd, cmd__len, CHAR);
_o_result = Platform_system(cmd, cmd__len);
__DEL(cmd); __DEL(cmd);
return _o_result; return Platform_system(cmd, cmd__len);
} }
int16 Platform_Error (void) int16 Platform_Error (void)
{ {
int16 _o_result; return Platform_err();
_o_result = Platform_err();
return _o_result;
} }
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openro(n, n__len); fd = Platform_openro(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_openrw(n, n__len); fd = Platform_openrw(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int16 fd; int16 fd;
fd = Platform_opennew(n, n__len); fd = Platform_opennew(n, n__len);
if (fd < 0) { if (fd < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Close (int32 h) int16 Platform_Close (int32 h)
{ {
int16 _o_result;
if (Platform_closefile(h) < 0) { if (Platform_closefile(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
__DUP(n, n__len, CHAR); __DUP(n, n__len, CHAR);
Platform_structstats(); Platform_structstats();
if (Platform_stat(n, n__len) < 0) { if (Platform_stat(n, n__len) < 0) {
_o_result = Platform_err();
__DEL(n); __DEL(n);
return _o_result; return Platform_err();
} }
(*identity).volume = Platform_statdev(); (*identity).volume = Platform_statdev();
(*identity).index = Platform_statino(); (*identity).index = Platform_statino();
(*identity).mtime = Platform_statmtime(); (*identity).mtime = Platform_statmtime();
_o_result = 0;
__DEL(n); __DEL(n);
return _o_result; return 0;
} }
BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (i1.index == i2.index && i1.volume == i2.volume);
_o_result = (i1.index == i2.index && i1.volume == i2.volume);
return _o_result;
} }
BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return i1.mtime == i2.mtime;
_o_result = i1.mtime == i2.mtime;
return _o_result;
} }
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, int32 *l)
{ {
int16 _o_result;
Platform_structstats(); Platform_structstats();
if (Platform_fstat(h) < 0) { if (Platform_fstat(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
*l = Platform_statsize(); *l = Platform_statsize();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, p, l); *n = Platform_readfile(h, p, l);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
{ {
int16 _o_result;
*n = Platform_readfile(h, (address)b, b__len); *n = Platform_readfile(h, (address)b, b__len);
if (*n < 0) { if (*n < 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Write (int32 h, int64 p, int32 l) int16 Platform_Write (int32 h, int64 p, int32 l)
{ {
int16 _o_result;
int64 written; int64 written;
written = Platform_writefile(h, p, l); written = Platform_writefile(h, p, l);
if (written < 0) { if (written < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Sync (int32 h) int16 Platform_Sync (int32 h)
{ {
int16 _o_result;
if (Platform_fsync(h) < 0) { if (Platform_fsync(h) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Seek (int32 h, int32 offset, int16 whence) int16 Platform_Seek (int32 h, int32 offset, int16 whence)
{ {
int16 _o_result;
if (Platform_lseek(h, offset, whence) < 0) { if (Platform_lseek(h, offset, whence) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Truncate (int32 h, int32 l) int16 Platform_Truncate (int32 h, int32 l)
{ {
int16 _o_result;
if (Platform_ftruncate(h, l) < 0) { if (Platform_ftruncate(h, l) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Unlink (CHAR *n, LONGINT n__len) int16 Platform_Unlink (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_unlink(n, n__len) < 0) { if (Platform_unlink(n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Chdir (CHAR *n, LONGINT n__len) int16 Platform_Chdir (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
int16 r; int16 r;
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
_o_result = 0; return 0;
return _o_result;
} else { } else {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_rename(o, o__len, n, n__len) < 0) { if (Platform_rename(o, o__len, n, n__len) < 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i);
REAL Reals_Ten (int16 e) REAL Reals_Ten (int16 e)
{ {
REAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
LONGREAL Reals_TenL (int16 e) LONGREAL Reals_TenL (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e)
} }
e = __ASHR(e, 1); e = __ASHR(e, 1);
if (e <= 0) { if (e <= 0) {
_o_result = r; return r;
return _o_result;
} }
power = power * power; power = power * power;
} }
@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e)
int16 Reals_Expo (REAL x) int16 Reals_Expo (REAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 2, i, int16); __GET((address)&x + 2, i, int16);
_o_result = __MASK(__ASHR(i, 7), -256); return __MASK(__ASHR(i, 7), -256);
return _o_result;
} }
void Reals_SetExpo (REAL *x, int16 ex) void Reals_SetExpo (REAL *x, int16 ex)
@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex)
int16 Reals_ExpoL (LONGREAL x) int16 Reals_ExpoL (LONGREAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 6, i, int16); __GET((address)&x + 6, i, int16);
_o_result = __MASK(__ASHR(i, 4), -2048); return __MASK(__ASHR(i, 4), -2048);
return _o_result;
} }
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
static CHAR Reals_ToHex (int16 i) static CHAR Reals_ToHex (int16 i)
{ {
CHAR _o_result;
if (i < 10) { if (i < 10) {
_o_result = (CHAR)(i + 48); return (CHAR)(i + 48);
return _o_result;
} else { } else {
_o_result = (CHAR)(i + 55); return (CHAR)(i + 55);
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR
int16 Strings_Length (CHAR *s, LONGINT s__len) int16 Strings_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int32 i; int32 i;
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
i = 0; i = 0;
@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
i += 1; i += 1;
} }
if (i <= 32767) { if (i <= 32767) {
_o_result = (int16)i;
__DEL(s); __DEL(s);
return _o_result; return (int16)i;
} else { } else {
_o_result = 32767;
__DEL(s); __DEL(s);
return _o_result; return 32767;
} }
__RETCHK; __RETCHK;
} }
@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
} }
if (pos > n1) { if (pos > n1) {
Strings_Append(dest, dest__len, (void*)source, source__len); Strings_Append(dest, dest__len, (void*)source, source__len);
__DEL(source);
return; return;
} }
if ((pos + n2) < dest__len) { if ((pos + n2) < dest__len) {
@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
} }
if (pos >= len) { if (pos >= len) {
dest[0] = 0x00; dest[0] = 0x00;
__DEL(source);
return; return;
} }
i = 0; i = 0;
@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
{ {
int16 _o_result;
int16 n1, n2, i, j; int16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len); n1 = Strings_Length(s, s__len);
n2 = Strings_Length(pattern, pattern__len); n2 = Strings_Length(pattern, pattern__len);
if (n2 == 0) { if (n2 == 0) {
_o_result = 0;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return 0;
} }
i = pos; i = pos;
while (i <= n1 - n2) { while (i <= n1 - n2) {
@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
j += 1; j += 1;
} }
if (j == n2) { if (j == n2) {
_o_result = i;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return i;
} }
} }
i += 1; i += 1;
} }
_o_result = -1;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return -1;
} }
void Strings_Cap (CHAR *s, LONGINT s__len) void Strings_Cap (CHAR *s, LONGINT s__len)
@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
{ {
BOOLEAN _o_result;
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {
_o_result = 0; return 0;
return _o_result;
} }
n -= 1; n -= 1;
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = n < 0; return n < 0;
return _o_result;
} }
while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { while ((m >= 0 && mask[__X(m, mask__len)] == '*')) {
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = 1; return 1;
return _o_result;
} }
while (n >= 0) { while (n >= 0) {
if (M__8(name, name__len, mask, mask__len, n, m)) { if (M__8(name, name__len, mask, mask__len, n, m)) {
_o_result = 1; return 1;
return _o_result;
} }
n -= 1; n -= 1;
} }
_o_result = 0; return 0;
return _o_result;
} }
BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len)
{ {
BOOLEAN _o_result;
struct Match__7 _s; struct Match__7 _s;
__DUP(string, string__len, CHAR); __DUP(string, string__len, CHAR);
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
_s.lnk = Match__7_s; _s.lnk = Match__7_s;
Match__7_s = &_s; Match__7_s = &_s;
_o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
Match__7_s = _s.lnk; Match__7_s = _s.lnk;
__DEL(string); __DEL(string);
__DEL(pattern); __DEL(pattern);
return _o_result; return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
} }

View file

@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
{ {
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL; Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc); __NEW(F, Texts_FontDesc);
__COPY(name, F->name, 32); __COPY(name, F->name, 32);
_o_result = F; return F;
return _o_result;
} }
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas
static Texts_Piece Texts_ClonePiece (Texts_Piece p) static Texts_Piece Texts_ClonePiece (Texts_Piece p)
{ {
Texts_Piece _o_result;
Texts_Piece q = NIL; Texts_Piece q = NIL;
__NEW(q, Texts_PieceDesc); __NEW(q, Texts_PieceDesc);
__GUARDEQP(q, Texts_PieceDesc) = *p; __GUARDEQP(q, Texts_PieceDesc) = *p;
_o_result = q; return q;
return _o_result;
} }
static Texts_Elem Texts_CloneElem (Texts_Elem e) static Texts_Elem Texts_CloneElem (Texts_Elem e)
{ {
Texts_Elem _o_result;
Texts_CopyMsg msg; Texts_CopyMsg msg;
msg.e = NIL; msg.e = NIL;
(*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ);
_o_result = msg.e; return msg.e;
return _o_result;
} }
void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
Texts_Text Texts_ElemBase (Texts_Elem E) Texts_Text Texts_ElemBase (Texts_Elem E)
{ {
Texts_Text _o_result; return E->base;
_o_result = E->base;
return _o_result;
} }
int32 Texts_ElemPos (Texts_Elem E) int32 Texts_ElemPos (Texts_Elem E)
{ {
int32 _o_result;
Texts_Run u = NIL; Texts_Run u = NIL;
int32 pos; int32 pos;
u = E->base->head->next; u = E->base->head->next;
@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E)
pos = pos + u->len; pos = pos + u->len;
u = u->next; u = u->next;
} }
_o_result = pos; return pos;
return _o_result;
} }
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
int32 Texts_Pos (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ)
{ {
int32 _o_result; return (*R).org + (*R).off;
_o_result = (*R).org + (*R).off;
return _o_result;
} }
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)

View file

@ -317,14 +317,11 @@ void Files_Close (Files_File f)
int32 Files_Length (Files_File f) int32 Files_Length (Files_File f)
{ {
int32 _o_result; return f->len;
_o_result = f->len;
return _o_result;
} }
Files_File Files_New (CHAR *name, LONGINT name__len) Files_File Files_New (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
f->len = 0; f->len = 0;
f->pos = 0; f->pos = 0;
f->swapper = -1; f->swapper = -1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
CHAR ch; CHAR ch;
i = 0; i = 0;
@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
i += 1; i += 1;
ch = name[i]; ch = name[i];
} }
_o_result = ch == '/'; return ch == '/';
return _o_result;
} }
static Files_File Files_CacheEntry (Platform_FileIdentity identity) static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int16 i, error; int16 i, error;
f = Files_files; f = Files_files;
@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
f->identity = identity; f->identity = identity;
error = Platform_Size(f->fd, &f->len); error = Platform_Size(f->fd, &f->len);
} }
_o_result = f; return f;
return _o_result;
} }
f = f->next; f = f->next;
} }
_o_result = NIL; return NIL;
return _o_result;
} }
Files_File Files_Old (CHAR *name, LONGINT name__len) Files_File Files_Old (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int32 fd; int32 fd;
int16 pos; int16 pos;
@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
f = Files_CacheEntry(identity); f = Files_CacheEntry(identity);
if (f != NIL) { if (f != NIL) {
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} else { } else {
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
Heap_RegisterFinalizer((void*)f, Files_Finalize); Heap_RegisterFinalizer((void*)f, Files_Finalize);
@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->next = Files_files; f->next = Files_files;
Files_files = f; Files_files = f;
Heap_FileCount += 1; Heap_FileCount += 1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
} else if (dir[0] == 0x00) { } else if (dir[0] == 0x00) {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} else { } else {
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256); Files_ScanPath(&pos, (void*)dir, 256);
} }
} }
} else { } else {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }
@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d)
int32 Files_Pos (Files_Rider *r, address *r__typ) int32 Files_Pos (Files_Rider *r, address *r__typ)
{ {
int32 _o_result; return (*r).org + (*r).offset;
_o_result = (*r).org + (*r).offset;
return _o_result;
} }
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
Files_File Files_Base (Files_Rider *r, address *r__typ) Files_File Files_Base (Files_Rider *r, address *r__typ)
{ {
Files_File _o_result; return (*r).buf->f;
_o_result = (*r).buf->f;
return _o_result;
} }
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
error = Platform_Rename((void*)old, old__len, (void*)new, new__len); error = Platform_Rename((void*)old, old__len, (void*)new, new__len);
if (!Platform_DifferentFilesystems(error)) { if (!Platform_DifferentFilesystems(error)) {
*res = error; *res = error;
__DEL(old);
__DEL(new);
return; return;
} else { } else {
error = Platform_OldRO((void*)old, old__len, &fdold); error = Platform_OldRO((void*)old, old__len, &fdold);
if (error != 0) { if (error != 0) {
*res = 2; *res = 2;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_New((void*)new, new__len, &fdnew); error = Platform_New((void*)new, new__len, &fdnew);
if (error != 0) { if (error != 0) {
error = Platform_Close(fdold); error = Platform_Close(fdold);
*res = 3; *res = 3;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_Read(fdold, (address)buf, 4096, &n); error = Platform_Read(fdold, (address)buf, 4096, &n);

View file

@ -127,7 +127,6 @@ void Heap_Unlock (void)
SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
{ {
SYSTEM_PTR _o_result;
Heap_Module m; Heap_Module m;
if (__STRCMP(name, "Heap") == 0) { if (__STRCMP(name, "Heap") == 0) {
__SYSNEW(m, 48); __SYSNEW(m, 48);
@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
m->enumPtrs = enumPtrs; m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(address)Heap_modules; m->next = (Heap_Module)(address)Heap_modules;
Heap_modules = (SYSTEM_PTR)m; Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m; return (void*)m;
return _o_result;
} }
void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m)
static int32 Heap_NewChunk (int32 blksz) static int32 Heap_NewChunk (int32 blksz)
{ {
int32 _o_result;
int32 chnk; int32 chnk;
chnk = Heap_OSAllocate(blksz + 12); chnk = Heap_OSAllocate(blksz + 12);
if (chnk != 0) { if (chnk != 0) {
@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz)
Heap_bigBlocks = chnk + 12; Heap_bigBlocks = chnk + 12;
Heap_heapsize += blksz; Heap_heapsize += blksz;
} }
_o_result = chnk; return chnk;
return _o_result;
} }
static void Heap_ExtendHeap (int32 blksz) static void Heap_ExtendHeap (int32 blksz)
@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz)
SYSTEM_PTR Heap_NEWREC (int32 tag) SYSTEM_PTR Heap_NEWREC (int32 tag)
{ {
SYSTEM_PTR _o_result;
int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
new = Heap_NEWREC(tag); new = Heap_NEWREC(tag);
} }
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} else { } else {
Heap_Unlock(); Heap_Unlock();
_o_result = NIL; return NIL;
return _o_result;
} }
} }
__GET(adr + 4, t, int32); __GET(adr + 4, t, int32);
@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
__PUT(adr + 8, 0, int32); __PUT(adr + 8, 0, int32);
Heap_allocated += blksz; Heap_allocated += blksz;
Heap_Unlock(); Heap_Unlock();
_o_result = (SYSTEM_PTR)(address)(adr + 4); return (SYSTEM_PTR)(address)(adr + 4);
return _o_result;
} }
SYSTEM_PTR Heap_NEWBLK (int32 size) SYSTEM_PTR Heap_NEWBLK (int32 size)
{ {
SYSTEM_PTR _o_result;
int32 blksz, tag; int32 blksz, tag;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size)
__PUT(tag + 4, -4, int32); __PUT(tag + 4, -4, int32);
__PUT((int32)(address)new - 4, tag, int32); __PUT((int32)(address)new - 4, tag, int32);
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} }
static void Heap_Mark (int32 q) static void Heap_Mark (int32 q)

View file

@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
{ {
Modules_Module _o_result;
Modules_Module m = NIL; Modules_Module m = NIL;
CHAR bodyname[64]; CHAR bodyname[64];
Modules_Command body; Modules_Command body;
@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
} }
_o_result = m;
__DEL(name); __DEL(name);
return _o_result; return m;
} }
Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len)
{ {
Modules_Command _o_result;
Modules_Cmd c = NIL; Modules_Cmd c = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
c = mod->cmds; c = mod->cmds;
@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
if (c != NIL) { if (c != NIL) {
Modules_res = 0; Modules_res = 0;
Modules_resMsg[0] = 0x00; Modules_resMsg[0] = 0x00;
_o_result = c->cmd;
__DEL(name); __DEL(name);
return _o_result; return c->cmd;
} else { } else {
Modules_res = 2; Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11); __MOVE(" command \"", Modules_resMsg, 11);
@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }

View file

@ -74,7 +74,6 @@ static void OPB_err (int16 n)
OPT_Node OPB_NewLeaf (OPT_Object obj) OPT_Node OPB_NewLeaf (OPT_Object obj)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
switch (obj->mode) { switch (obj->mode) {
case 1: case 1:
@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
} }
node->obj = obj; node->obj = obj;
node->typ = obj->typ; node->typ = obj->typ;
_o_result = node; return node;
return _o_result;
} }
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
static int16 OPB_BoolToInt (BOOLEAN b) static int16 OPB_BoolToInt (BOOLEAN b)
{ {
int16 _o_result;
if (b) { if (b) {
_o_result = 1; return 1;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
static BOOLEAN OPB_IntToBool (int64 i) static BOOLEAN OPB_IntToBool (int64 i)
{ {
BOOLEAN _o_result; return i != 0;
_o_result = i != 0;
return _o_result;
} }
OPT_Node OPB_NewBoolConst (BOOLEAN boolval) OPT_Node OPB_NewBoolConst (BOOLEAN boolval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_booltyp; x->typ = OPT_booltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = OPB_BoolToInt(boolval); x->conval->intval = OPB_BoolToInt(boolval);
_o_result = x; return x;
return _o_result;
} }
void OPB_OptIf (OPT_Node *x) void OPB_OptIf (OPT_Node *x)
@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x)
OPT_Node OPB_Nil (void) OPT_Node OPB_Nil (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_niltyp; x->typ = OPT_niltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = 0; x->conval->intval = 0;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_EmptySet (void) OPT_Node OPB_EmptySet (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_settyp; x->typ = OPT_settyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->setval = 0x0; x->conval->setval = 0x0;
_o_result = x; return x;
return _o_result;
} }
static void OPB_SetIntType (OPT_Node node) static void OPB_SetIntType (OPT_Node node)
@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node)
OPT_Node OPB_NewIntConst (int64 intval) OPT_Node OPB_NewIntConst (int64 intval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = intval; x->conval->intval = intval;
OPB_SetIntType(x); OPB_SetIntType(x);
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->realval = realval; x->conval->realval = realval;
x->typ = typ; x->typ = typ;
x->conval->intval = -1; x->conval->intval = -1;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewString (OPS_String str, int64 len) OPT_Node OPB_NewString (OPS_String str, int64 len)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len)
x->conval->intval2 = OPM_Longint(len); x->conval->intval2 = OPM_Longint(len);
x->conval->ext = OPT_NewExt(); x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, 256); __COPY(str, *x->conval->ext, 256);
_o_result = x; return x;
return _o_result;
} }
static void OPB_CharToString (OPT_Node n) static void OPB_CharToString (OPT_Node n)
@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN OPB_NotVar (OPT_Node x) static BOOLEAN OPB_NotVar (OPT_Node x)
{ {
BOOLEAN _o_result; return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
_o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
return _o_result;
} }
void OPB_DeRef (OPT_Node *x) void OPB_DeRef (OPT_Node *x)
@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y)
static int64 OPB_log (int64 x) static int64 OPB_log (int64 x)
{ {
int64 _o_result;
OPB_exp = 0; OPB_exp = 0;
if (x > 0) { if (x > 0) {
while (!__ODD(x)) { while (!__ODD(x)) {
@ -497,8 +475,7 @@ static int64 OPB_log (int64 x)
OPB_exp += 1; OPB_exp += 1;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(11); node = OPT_NewNode(11);
node->subcl = op; node->subcl = op;
node->typ = typ; node->typ = typ;
node->left = z; node->left = z;
_o_result = node; return node;
return _o_result;
} }
void OPB_MOp (int8 op, OPT_Node *x) void OPB_MOp (int8 op, OPT_Node *x)
@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void) static int16 ConstCmp__14 (void)
{ {
int16 _o_result;
int16 res; int16 res;
switch (*ConstOp__13_s->f) { switch (*ConstOp__13_s->f) {
case 0: case 0:
@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void)
break; break;
} }
(*ConstOp__13_s->x)->typ = OPT_booltyp; (*ConstOp__13_s->x)->typ = OPT_booltyp;
_o_result = res; return res;
return _o_result;
} }
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
{ {
BOOLEAN _o_result;
BOOLEAN ok, xCharArr, yCharArr; BOOLEAN ok, xCharArr, yCharArr;
xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8;
yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8;
@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
OPB_Index(&*x, OPB_NewIntConst(0)); OPB_Index(&*x, OPB_NewIntConst(0));
} }
} }
_o_result = ok; return ok;
return _o_result;
} }
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(class); node = OPT_NewNode(class);
node->subcl = subcl; node->subcl = subcl;
node->left = left; node->left = left;
node->right = right; node->right = right;
_o_result = node; return node;
return _o_result;
} }
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)

View file

@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static int16 OPC_Length (CHAR *s, LONGINT s__len) static int16 OPC_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
i = 0; i = 0;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
i += 1; i += 1;
} }
_o_result = i; return i;
return _o_result;
} }
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i, h; int16 i, h;
i = 0; i = 0;
h = 0; h = 0;
@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
h = 3 * h + (int16)s[__X(i, s__len)]; h = 3 * h + (int16)s[__X(i, s__len)];
i += 1; i += 1;
} }
_o_result = (int)__MOD(h, 105); return (int)__MOD(h, 105);
return _o_result;
} }
void OPC_Ident (OPT_Object obj) void OPC_Ident (OPT_Object obj)
@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
_o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result;
} }
static void OPC_DeclareBase (OPT_Object dcl) static void OPC_DeclareBase (OPT_Object dcl)
@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
int32 OPC_NofPtrs (OPT_Struct typ) int32 OPC_NofPtrs (OPT_Struct typ)
{ {
int32 _o_result;
OPT_Object fld = NIL; OPT_Object fld = NIL;
OPT_Struct btyp = NIL; OPT_Struct btyp = NIL;
int32 n; int32 n;
if ((typ->form == 11 && typ->sysflag == 0)) { if ((typ->form == 11 && typ->sysflag == 0)) {
_o_result = 1; return 1;
return _o_result;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp != NIL) { if (btyp != NIL) {
@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ)
} }
fld = fld->link; fld = fld->link;
} }
_o_result = n; return n;
return _o_result;
} else if (typ->comp == 2) { } else if (typ->comp == 2) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
n = typ->n; n = typ->n;
@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ)
n = btyp->n * n; n = btyp->n * n;
btyp = btyp->BaseTyp; btyp = btyp->BaseTyp;
} }
_o_result = OPC_NofPtrs(btyp) * n; return OPC_NofPtrs(btyp) * n;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Object OPC_BaseTProc (OPT_Object obj)
{ {
OPT_Object _o_result;
OPT_Struct typ = NIL, base = NIL; OPT_Struct typ = NIL, base = NIL;
int32 mno; int32 mno;
typ = obj->link->typ; typ = obj->link->typ;
@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj)
base = typ->BaseTyp; base = typ->BaseTyp;
} }
OPT_FindField(obj->name, typ, &obj); OPT_FindField(obj->name, typ, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
BOOLEAN r;
__DUP(y, y__len, CHAR); __DUP(y, y__len, CHAR);
i = 0; i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
i += 1; i += 1;
} }
r = y[__X(i, y__len)] == 0x00;
_o_result = r;
__DEL(y); __DEL(y);
return _o_result; return y[__X(i, y__len)] == 0x00;
} }
static void OPC_CProcDefs (OPT_Object obj, int16 vis) static void OPC_CProcDefs (OPT_Object obj, int16 vis)
@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc)
} }
OPC_ProcHeader(proc, 1); OPC_ProcHeader(proc, 1);
OPC_BegBlk(); OPC_BegBlk();
if (proc->typ != OPT_notyp) {
OPC_BegStat();
OPC_Ident(proc->typ->strobj);
OPM_WriteString((CHAR*)" _o_result;", 12);
OPM_WriteLn();
}
scope = proc->scope; scope = proc->scope;
OPC_IdentList(scope->scope, 0); OPC_IdentList(scope->scope, 0);
if (!scope->leaf) { if (!scope->leaf) {

View file

@ -124,33 +124,25 @@ void OPM_LogWLn (void)
int64 OPM_SignedMaximum (int32 bytecount) int64 OPM_SignedMaximum (int32 bytecount)
{ {
int64 _o_result;
int64 result; int64 result;
result = 1; result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
_o_result = result - 1; return result - 1;
return _o_result;
} }
int64 OPM_SignedMinimum (int32 bytecount) int64 OPM_SignedMinimum (int32 bytecount)
{ {
int64 _o_result; return -OPM_SignedMaximum(bytecount) - 1;
_o_result = -OPM_SignedMaximum(bytecount) - 1;
return _o_result;
} }
int32 OPM_Longint (int64 n) int32 OPM_Longint (int64 n)
{ {
int32 _o_result; return __VAL(int32, n);
_o_result = __VAL(int32, n);
return _o_result;
} }
int16 OPM_Integer (int64 n) int16 OPM_Integer (int64 n)
{ {
int16 _o_result; return __VAL(int16, n);
_o_result = __VAL(int16, n);
return _o_result;
} }
static void OPM_ScanOptions (CHAR *s, LONGINT s__len) static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
BOOLEAN OPM_OpenPar (void) BOOLEAN OPM_OpenPar (void)
{ {
BOOLEAN _o_result;
CHAR s[256]; CHAR s[256];
if (Platform_ArgCount == 1) { if (Platform_ArgCount == 1) {
OPM_LogWLn(); OPM_LogWLn();
@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr(Configuration_versionLong, 75); OPM_LogWStr(Configuration_versionLong, 75);
OPM_LogW('.'); OPM_LogW('.');
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68);
OPM_LogWLn(); OPM_LogWLn();
@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWStr((CHAR*)"Options:", 9);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWStr((CHAR*)" Run time safety", 18);
@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58);
@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn(); OPM_LogWLn();
_o_result = 0; return 0;
return _o_result;
} else { } else {
OPM_AddressSize = 4; OPM_AddressSize = 4;
OPM_GetAlignment(&OPM_Alignment); OPM_GetAlignment(&OPM_Alignment);
@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_GlobalAlignment = OPM_Alignment; OPM_GlobalAlignment = OPM_Alignment;
__COPY(OPM_Model, OPM_GlobalModel, 10); __COPY(OPM_Model, OPM_GlobalModel, 10);
OPM_GlobalOptions = OPM_Options; OPM_GlobalOptions = OPM_Options;
_o_result = 1; return 1;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch)
int32 OPM_SymRInt (void) int32 OPM_SymRInt (void)
{ {
int32 _o_result;
int32 k; int32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
_o_result = k; return k;
return _o_result;
} }
int64 OPM_SymRInt64 (void) int64 OPM_SymRInt64 (void)
{ {
int64 _o_result;
int64 k; int64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
_o_result = k; return k;
return _o_result;
} }
void OPM_SymRSet (uint64 *s) void OPM_SymRSet (uint64 *s)
@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
BOOLEAN OPM_eofSF (void) BOOLEAN OPM_eofSF (void)
{ {
BOOLEAN _o_result; return OPM_oldSF.eof;
_o_result = OPM_oldSF.eof;
return _o_result;
} }
void OPM_SymWCh (CHAR ch) void OPM_SymWCh (CHAR ch)

View file

@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
{ {
BOOLEAN _o_result;
if ((b->form == 11 && x->form == 11)) { if ((b->form == 11 && x->form == 11)) {
b = b->BaseTyp; b = b->BaseTyp;
x = x->BaseTyp; x = x->BaseTyp;
@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
x = x->BaseTyp; x = x->BaseTyp;
} while (!(x == NIL || x == b)); } while (!(x == NIL || x == b));
} }
_o_result = x == b; return x == b;
return _o_result;
} }
static struct ProcedureDeclaration__16 { static struct ProcedureDeclaration__16 {

View file

@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e);
static LONGREAL Ten__9 (int16 e) static LONGREAL Ten__9 (int16 e)
{ {
LONGREAL _o_result;
LONGREAL x, p; LONGREAL x, p;
x = (LONGREAL)1; x = (LONGREAL)1;
p = (LONGREAL)10; p = (LONGREAL)10;
@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e)
p = p * p; p = p * p;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static int16 Ord__7 (CHAR ch, BOOLEAN hex) static int16 Ord__7 (CHAR ch, BOOLEAN hex)
{ {
int16 _o_result;
if (ch <= '9') { if (ch <= '9') {
_o_result = (int16)ch - 48; return (int16)ch - 48;
return _o_result;
} else if (hex) { } else if (hex) {
_o_result = ((int16)ch - 65) + 10; return ((int16)ch - 65) + 10;
return _o_result;
} else { } else {
OPS_err(2); OPS_err(2);
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -324,6 +318,7 @@ void OPS_Get (int8 *sym)
while (OPS_ch <= ' ') { while (OPS_ch <= ' ') {
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
*sym = 64; *sym = 64;
Get__1_s = _s.lnk;
return; return;
} else { } else {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);

View file

@ -179,7 +179,6 @@ static void OPT_err (int16 n)
int16 OPT_IntSize (int64 n) int16 OPT_IntSize (int64 n)
{ {
int16 _o_result;
int16 bytes; int16 bytes;
if (n < 0) { if (n < 0) {
n = -(n + 1); n = -(n + 1);
@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n)
while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) {
bytes += 1; bytes += 1;
} }
_o_result = bytes; return bytes;
return _o_result;
} }
OPT_Struct OPT_IntType (int32 size) OPT_Struct OPT_IntType (int32 size)
{ {
OPT_Struct _o_result;
if (size <= OPT_int8typ->size) { if (size <= OPT_int8typ->size) {
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
if (size <= OPT_int16typ->size) { if (size <= OPT_int16typ->size) {
_o_result = OPT_int16typ; return OPT_int16typ;
return _o_result;
} }
if (size <= OPT_int32typ->size) { if (size <= OPT_int32typ->size) {
_o_result = OPT_int32typ; return OPT_int32typ;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} }
OPT_Struct OPT_SetType (int32 size) OPT_Struct OPT_SetType (int32 size)
{ {
OPT_Struct _o_result;
if (size == OPT_set32typ->size) { if (size == OPT_set32typ->size) {
_o_result = OPT_set32typ; return OPT_set32typ;
return _o_result;
} }
_o_result = OPT_set64typ; return OPT_set64typ;
return _o_result;
} }
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
{ {
OPT_Struct _o_result;
int16 i; int16 i;
__ASSERT(x->form == 4, 0); __ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0); __ASSERT(dir == 1 || dir == -1, 0);
if (dir > 0) { if (dir > 0) {
if (x->size < OPT_sinttyp->size) { if (x->size < OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
if (x->size < OPT_inttyp->size) { if (x->size < OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size < OPT_linttyp->size) { if (x->size < OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} else { } else {
if (x->size > OPT_linttyp->size) { if (x->size > OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
if (x->size > OPT_inttyp->size) { if (x->size > OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size > OPT_sinttyp->size) { if (x->size > OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base)
int32 OPT_SizeAlignment (int32 size) int32 OPT_SizeAlignment (int32 size)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (size < OPM_Alignment) { if (size < OPM_Alignment) {
alignment = 1; alignment = 1;
@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size)
} else { } else {
alignment = OPM_Alignment; alignment = OPM_Alignment;
} }
_o_result = alignment; return alignment;
return _o_result;
} }
int32 OPT_BaseAlignment (OPT_Struct typ) int32 OPT_BaseAlignment (OPT_Struct typ)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (typ->form == 13) { if (typ->form == 13) {
if (typ->comp == 4) { if (typ->comp == 4) {
@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
} else { } else {
alignment = OPT_SizeAlignment(typ->size); alignment = OPT_SizeAlignment(typ->size);
} }
_o_result = alignment; return alignment;
return _o_result;
} }
void OPT_TypSize (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ)
@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ)
OPT_Const OPT_NewConst (void) OPT_Const OPT_NewConst (void)
{ {
OPT_Const _o_result;
OPT_Const const_ = NIL; OPT_Const const_ = NIL;
__NEW(const_, OPT_ConstDesc); __NEW(const_, OPT_ConstDesc);
_o_result = const_; return const_;
return _o_result;
} }
OPT_Object OPT_NewObj (void) OPT_Object OPT_NewObj (void)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
__NEW(obj, OPT_ObjDesc); __NEW(obj, OPT_ObjDesc);
_o_result = obj; return obj;
return _o_result;
} }
OPT_Struct OPT_NewStr (int8 form, int8 comp) OPT_Struct OPT_NewStr (int8 form, int8 comp)
{ {
OPT_Struct _o_result;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc); __NEW(typ, OPT_StrDesc);
typ->form = form; typ->form = form;
@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
} }
typ->size = -1; typ->size = -1;
typ->BaseTyp = OPT_undftyp; typ->BaseTyp = OPT_undftyp;
_o_result = typ; return typ;
return _o_result;
} }
OPT_Node OPT_NewNode (int8 class) OPT_Node OPT_NewNode (int8 class)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc); __NEW(node, OPT_NodeDesc);
node->class = class; node->class = class;
_o_result = node; return node;
return _o_result;
} }
OPT_ConstExt OPT_NewExt (void) OPT_ConstExt OPT_NewExt (void)
{ {
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL; OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, 256); ext = __NEWARR(NIL, 1, 1, 1, 0, 256);
_o_result = ext; return ext;
return _o_result;
} }
void OPT_OpenScope (int8 level, OPT_Object owner) void OPT_OpenScope (int8 level, OPT_Object owner)
@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void) static OPT_Object OPT_InFld (void)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void)
obj->vis = 0; obj->vis = 0;
obj->adr = OPM_SymRInt(); obj->adr = OPM_SymRInt();
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Object OPT_InTProc (int8 mno) static OPT_Object OPT_InTProc (int8 mno)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno)
obj->vis = 0; obj->vis = 0;
obj->adr = __ASHL(OPM_SymRInt(), 16); obj->adr = __ASHL(OPM_SymRInt(), 16);
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Struct OPT_InTyp (int32 tag) static OPT_Struct OPT_InTyp (int32 tag)
{ {
OPT_Struct _o_result;
if (tag == 4) { if (tag == 4) {
_o_result = OPT_IntType(OPM_SymRInt()); return OPT_IntType(OPM_SymRInt());
return _o_result;
} else if (tag == 7) { } else if (tag == 7) {
_o_result = OPT_SetType(OPM_SymRInt()); return OPT_SetType(OPM_SymRInt());
return _o_result;
} else { } else {
_o_result = OPT_impCtxt.ref[__X(tag, 255)]; return OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ)
static OPT_Object OPT_InObj (int8 mno) static OPT_Object OPT_InObj (int8 mno)
{ {
OPT_Object _o_result;
int16 i, s; int16 i, s;
CHAR ch; CHAR ch;
OPT_Object obj = NIL, old = NIL; OPT_Object obj = NIL, old = NIL;
@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno)
} }
} }
} }
_o_result = obj; return obj;
return _o_result;
} }
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)

View file

@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope)
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
{ {
int16 _o_result;
switch (class) { switch (class) {
case 7: case 0: case 2: case 4: case 9: case 7: case 0: case 2: case 4: case 9:
case 13: case 13:
_o_result = 10; return 10;
return _o_result;
break; break;
case 5: case 5:
if (__IN(3, OPM_Options, 32)) { if (__IN(3, OPM_Options, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 1: case 1:
if (__IN(comp, 0x0c, 32)) { if (__IN(comp, 0x0c, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 3: case 3:
_o_result = 9; return 9;
return _o_result;
break; break;
case 11: case 11:
switch (subclass) { switch (subclass) {
case 33: case 7: case 24: case 29: case 20: case 33: case 7: case 24: case 29: case 20:
_o_result = 9; return 9;
return _o_result;
break; break;
case 16: case 21: case 22: case 23: case 25: case 16: case 21: case 22: case 23: case 25:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55);
@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
switch (subclass) { switch (subclass) {
case 1: case 1:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 2: case 2:
if (form == 7) { if (form == 7) {
_o_result = 3; return 3;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 3: case 4: case 3: case 4:
_o_result = 10; return 10;
return _o_result;
break; break;
case 6: case 6:
if (form == 7) { if (form == 7) {
_o_result = 2; return 2;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 7: case 7:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 11: case 12: case 13: case 14: case 11: case 12: case 13: case 14:
_o_result = 6; return 6;
return _o_result;
break; break;
case 9: case 10: case 9: case 10:
_o_result = 5; return 5;
return _o_result;
break; break;
case 5: case 5:
_o_result = 1; return 1;
return _o_result;
break; break;
case 8: case 8:
_o_result = 0; return 0;
return _o_result;
break; break;
case 19: case 15: case 17: case 18: case 26: case 19: case 15: case 17: case 18: case 26:
case 27: case 28: case 27: case 28:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55);
@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
} }
break; break;
case 10: case 10:
_o_result = 10; return 10;
return _o_result;
break; break;
case 8: case 6: case 8: case 6:
_o_result = 12; return 12;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43);
@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim)
static BOOLEAN OPV_SideEffects (OPT_Node n) static BOOLEAN OPV_SideEffects (OPT_Node n)
{ {
BOOLEAN _o_result;
if (n != NIL) { if (n != NIL) {
_o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right);
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
static OPT_Object OPV_SuperProc (OPT_Node n) static OPT_Object OPV_SuperProc (OPT_Node n)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
typ = n->right->typ; typ = n->right->typ;
@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }
OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPV_expr (OPT_Node n, int16 prec) static void OPV_expr (OPT_Node n, int16 prec)
@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
{ {
BOOLEAN _o_result;
while ((n != NIL && n->class != 26)) { while ((n != NIL && n->class != 26)) {
n = n->link; n = n->link;
} }
_o_result = n == NIL; return n == NIL;
return _o_result;
} }
static void OPV_NewArr (OPT_Node d, OPT_Node x) static void OPV_NewArr (OPT_Node d, OPT_Node x)
@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
OPM_WriteString((CHAR*)"__ENDMOD", 9); OPM_WriteString((CHAR*)"__ENDMOD", 9);
} }
} else { } else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);
if (n->left != NIL) { if (n->left != NIL) {
OPM_WriteString((CHAR*)"_o_result = ", 13); OPM_Write(' ');
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8); OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10); OPV_expr(n->left, 10);
} else { } else {
OPV_expr(n->left, -1); OPV_expr(n->left, -1);
} }
OPM_WriteString((CHAR*)";", 2);
OPM_WriteLn();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return _o_result", 17);
} else {
OPM_WriteString((CHAR*)"return", 7);
} }
} }
break; break;

View file

@ -56,14 +56,12 @@ void Out_Char (CHAR ch)
static int32 Out_Length (CHAR *s, LONGINT s__len) static int32 Out_Length (CHAR *s, LONGINT s__len)
{ {
int32 _o_result;
int32 l; int32 l;
l = 0; l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) { while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1; l += 1;
} }
_o_result = l; return l;
return _o_result;
} }
void Out_String (CHAR *str, LONGINT str__len) void Out_String (CHAR *str, LONGINT str__len)
@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
LONGREAL Out_Ten (int16 e) LONGREAL Out_Ten (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)

View file

@ -186,65 +186,47 @@ extern void Heap_InitHeap();
BOOLEAN Platform_TooManyFiles (int16 e) BOOLEAN Platform_TooManyFiles (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORTOOMANYOPENFILES();
_o_result = e == Platform_ERRORTOOMANYOPENFILES();
return _o_result;
} }
BOOLEAN Platform_NoSuchDirectory (int16 e) BOOLEAN Platform_NoSuchDirectory (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORPATHNOTFOUND();
_o_result = e == Platform_ERRORPATHNOTFOUND();
return _o_result;
} }
BOOLEAN Platform_DifferentFilesystems (int16 e) BOOLEAN Platform_DifferentFilesystems (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORNOTSAMEDEVICE();
_o_result = e == Platform_ERRORNOTSAMEDEVICE();
return _o_result;
} }
BOOLEAN Platform_Inaccessible (int16 e) BOOLEAN Platform_Inaccessible (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION();
_o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION();
return _o_result;
} }
BOOLEAN Platform_Absent (int16 e) BOOLEAN Platform_Absent (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND();
_o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND();
return _o_result;
} }
BOOLEAN Platform_TimedOut (int16 e) BOOLEAN Platform_TimedOut (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ETIMEDOUT();
_o_result = e == Platform_ETIMEDOUT();
return _o_result;
} }
BOOLEAN Platform_ConnectionFailed (int16 e) BOOLEAN Platform_ConnectionFailed (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
_o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
return _o_result;
} }
BOOLEAN Platform_Interrupted (int16 e) BOOLEAN Platform_Interrupted (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EINTR();
_o_result = e == Platform_EINTR();
return _o_result;
} }
int32 Platform_OSAllocate (int32 size) int32 Platform_OSAllocate (int32 size)
{ {
int32 _o_result; return Platform_allocate(size);
_o_result = Platform_allocate(size);
return _o_result;
} }
void Platform_OSFree (int32 address) void Platform_OSFree (int32 address)
@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int32 argvadr)
BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
{ {
BOOLEAN _o_result;
CHAR buf[4096]; CHAR buf[4096];
int16 res; int16 res;
__DUP(var, var__len, CHAR); __DUP(var, var__len, CHAR);
res = Platform_getenv(var, var__len, (void*)buf, 4096); res = Platform_getenv(var, var__len, (void*)buf, 4096);
if ((res > 0 && res < 4096)) { if ((res > 0 && res < 4096)) {
__COPY(buf, val, val__len); __COPY(buf, val, val__len);
_o_result = 1;
__DEL(var); __DEL(var);
return _o_result; return 1;
} else { } else {
_o_result = 0;
__DEL(var); __DEL(var);
return _o_result; return 0;
} }
__RETCHK; __RETCHK;
} }
@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val)
int16 Platform_ArgPos (CHAR *s, LONGINT s__len) int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
CHAR arg[256]; CHAR arg[256];
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
i += 1; i += 1;
Platform_GetArg(i, (void*)arg, 256); Platform_GetArg(i, (void*)arg, 256);
} }
_o_result = i;
__DEL(s); __DEL(s);
return _o_result; return i;
} }
void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d)
int32 Platform_Time (void) int32 Platform_Time (void)
{ {
int32 _o_result;
int32 ms; int32 ms;
ms = Platform_GetTickCount(); ms = Platform_GetTickCount();
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
} }
void Platform_Delay (int32 ms) void Platform_Delay (int32 ms)
@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
int16 Platform_System (CHAR *cmd, LONGINT cmd__len) int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{ {
int16 _o_result;
int16 result; int16 result;
__DUP(cmd, cmd__len, CHAR); __DUP(cmd, cmd__len, CHAR);
result = 127; result = 127;
@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
} }
Platform_cleanupProcess(); Platform_cleanupProcess();
} }
_o_result = __ASHL(result, 8);
__DEL(cmd); __DEL(cmd);
return _o_result; return __ASHL(result, 8);
} }
int16 Platform_Error (void) int16 Platform_Error (void)
{ {
int16 _o_result; return Platform_err();
_o_result = Platform_err();
return _o_result;
} }
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_openro(n, n__len); fd = Platform_openro(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_openrw(n, n__len); fd = Platform_openrw(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_opennew(n, n__len); fd = Platform_opennew(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Close (int32 h) int16 Platform_Close (int32 h)
{ {
int16 _o_result;
if (Platform_closeHandle(h) == 0) { if (Platform_closeHandle(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
Platform_byHandleFileInformation(); Platform_byHandleFileInformation();
if (Platform_getFileInformationByHandle(h) == 0) { if (Platform_getFileInformationByHandle(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
(*identity).volume = Platform_bhfiVsn(); (*identity).volume = Platform_bhfiVsn();
(*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexhigh = Platform_bhfiIndexHigh();
(*identity).indexlow = Platform_bhfiIndexLow(); (*identity).indexlow = Platform_bhfiIndexLow();
(*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimehigh = Platform_bhfiMtimeHigh();
(*identity).mtimelow = Platform_bhfiMtimeLow(); (*identity).mtimelow = Platform_bhfiMtimeLow();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
int32 h; int32 h;
int16 e, i; int16 e, i;
__DUP(n, n__len, CHAR); __DUP(n, n__len, CHAR);
e = Platform_OldRO((void*)n, n__len, &h); e = Platform_OldRO((void*)n, n__len, &h);
if (e != 0) { if (e != 0) {
_o_result = e;
__DEL(n); __DEL(n);
return _o_result; return e;
} }
e = Platform_Identify(h, &*identity, identity__typ); e = Platform_Identify(h, &*identity, identity__typ);
i = Platform_Close(h); i = Platform_Close(h);
_o_result = e;
__DEL(n); __DEL(n);
return _o_result; return e;
} }
BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume);
_o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume);
return _o_result;
} }
BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow);
_o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow);
return _o_result;
} }
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, int32 *l)
{ {
int16 _o_result;
Platform_largeInteger(); Platform_largeInteger();
if (Platform_getFileSize(h) == 0) { if (Platform_getFileSize(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
*l = Platform_liLongint(); *l = Platform_liLongint();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
{ {
int16 _o_result;
int16 result; int16 result;
int32 lengthread; int32 lengthread;
result = Platform_readfile(h, p, l, &lengthread); result = Platform_readfile(h, p, l, &lengthread);
if (result == 0) { if (result == 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*n = lengthread; *n = lengthread;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
{ {
int16 _o_result;
int16 result; int16 result;
int32 lengthread; int32 lengthread;
result = Platform_readfile(h, (address)b, b__len, &lengthread); result = Platform_readfile(h, (address)b, b__len, &lengthread);
if (result == 0) { if (result == 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*n = lengthread; *n = lengthread;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Write (int32 h, int32 p, int32 l) int16 Platform_Write (int32 h, int32 p, int32 l)
{ {
int16 _o_result;
if (Platform_writefile(h, p, l) == 0) { if (Platform_writefile(h, p, l) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Sync (int32 h) int16 Platform_Sync (int32 h)
{ {
int16 _o_result;
if (Platform_flushFileBuffers(h) == 0) { if (Platform_flushFileBuffers(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Seek (int32 h, int32 o, int16 r) int16 Platform_Seek (int32 h, int32 o, int16 r)
{ {
int16 _o_result;
int16 rc; int16 rc;
Platform_largeInteger(); Platform_largeInteger();
Platform_setFilePointerEx(h, o, r, &rc); Platform_setFilePointerEx(h, o, r, &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Truncate (int32 h, int32 limit) int16 Platform_Truncate (int32 h, int32 limit)
{ {
int16 _o_result;
int16 rc; int16 rc;
int32 oldpos; int32 oldpos;
Platform_largeInteger(); Platform_largeInteger();
Platform_getFilePos(h, &oldpos, &rc); Platform_getFilePos(h, &oldpos, &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
if (Platform_setEndOfFile(h) == 0) { if (Platform_setEndOfFile(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Unlink (CHAR *n, LONGINT n__len) int16 Platform_Unlink (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_deleteFile(n, n__len) == 0) { if (Platform_deleteFile(n, n__len) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Chdir (CHAR *n, LONGINT n__len) int16 Platform_Chdir (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
int16 r; int16 r;
r = Platform_setCurrentDirectory(n, n__len); r = Platform_setCurrentDirectory(n, n__len);
if (r == 0) { if (r == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_getCurrentDirectory((void*)Platform_CWD, 4096);
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_moveFile(o, o__len, n, n__len) == 0) { if (Platform_moveFile(o, o__len, n, n__len) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i);
REAL Reals_Ten (int16 e) REAL Reals_Ten (int16 e)
{ {
REAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
LONGREAL Reals_TenL (int16 e) LONGREAL Reals_TenL (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e)
} }
e = __ASHR(e, 1); e = __ASHR(e, 1);
if (e <= 0) { if (e <= 0) {
_o_result = r; return r;
return _o_result;
} }
power = power * power; power = power * power;
} }
@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e)
int16 Reals_Expo (REAL x) int16 Reals_Expo (REAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 2, i, int16); __GET((address)&x + 2, i, int16);
_o_result = __MASK(__ASHR(i, 7), -256); return __MASK(__ASHR(i, 7), -256);
return _o_result;
} }
void Reals_SetExpo (REAL *x, int16 ex) void Reals_SetExpo (REAL *x, int16 ex)
@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex)
int16 Reals_ExpoL (LONGREAL x) int16 Reals_ExpoL (LONGREAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 6, i, int16); __GET((address)&x + 6, i, int16);
_o_result = __MASK(__ASHR(i, 4), -2048); return __MASK(__ASHR(i, 4), -2048);
return _o_result;
} }
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
static CHAR Reals_ToHex (int16 i) static CHAR Reals_ToHex (int16 i)
{ {
CHAR _o_result;
if (i < 10) { if (i < 10) {
_o_result = (CHAR)(i + 48); return (CHAR)(i + 48);
return _o_result;
} else { } else {
_o_result = (CHAR)(i + 55); return (CHAR)(i + 55);
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR
int16 Strings_Length (CHAR *s, LONGINT s__len) int16 Strings_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int32 i; int32 i;
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
i = 0; i = 0;
@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
i += 1; i += 1;
} }
if (i <= 32767) { if (i <= 32767) {
_o_result = (int16)i;
__DEL(s); __DEL(s);
return _o_result; return (int16)i;
} else { } else {
_o_result = 32767;
__DEL(s); __DEL(s);
return _o_result; return 32767;
} }
__RETCHK; __RETCHK;
} }
@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
} }
if (pos > n1) { if (pos > n1) {
Strings_Append(dest, dest__len, (void*)source, source__len); Strings_Append(dest, dest__len, (void*)source, source__len);
__DEL(source);
return; return;
} }
if ((pos + n2) < dest__len) { if ((pos + n2) < dest__len) {
@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
} }
if (pos >= len) { if (pos >= len) {
dest[0] = 0x00; dest[0] = 0x00;
__DEL(source);
return; return;
} }
i = 0; i = 0;
@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
{ {
int16 _o_result;
int16 n1, n2, i, j; int16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len); n1 = Strings_Length(s, s__len);
n2 = Strings_Length(pattern, pattern__len); n2 = Strings_Length(pattern, pattern__len);
if (n2 == 0) { if (n2 == 0) {
_o_result = 0;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return 0;
} }
i = pos; i = pos;
while (i <= n1 - n2) { while (i <= n1 - n2) {
@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
j += 1; j += 1;
} }
if (j == n2) { if (j == n2) {
_o_result = i;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return i;
} }
} }
i += 1; i += 1;
} }
_o_result = -1;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return -1;
} }
void Strings_Cap (CHAR *s, LONGINT s__len) void Strings_Cap (CHAR *s, LONGINT s__len)
@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
{ {
BOOLEAN _o_result;
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {
_o_result = 0; return 0;
return _o_result;
} }
n -= 1; n -= 1;
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = n < 0; return n < 0;
return _o_result;
} }
while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { while ((m >= 0 && mask[__X(m, mask__len)] == '*')) {
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = 1; return 1;
return _o_result;
} }
while (n >= 0) { while (n >= 0) {
if (M__8(name, name__len, mask, mask__len, n, m)) { if (M__8(name, name__len, mask, mask__len, n, m)) {
_o_result = 1; return 1;
return _o_result;
} }
n -= 1; n -= 1;
} }
_o_result = 0; return 0;
return _o_result;
} }
BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len)
{ {
BOOLEAN _o_result;
struct Match__7 _s; struct Match__7 _s;
__DUP(string, string__len, CHAR); __DUP(string, string__len, CHAR);
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
_s.lnk = Match__7_s; _s.lnk = Match__7_s;
Match__7_s = &_s; Match__7_s = &_s;
_o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
Match__7_s = _s.lnk; Match__7_s = _s.lnk;
__DEL(string); __DEL(string);
__DEL(pattern); __DEL(pattern);
return _o_result; return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
} }

View file

@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
{ {
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL; Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc); __NEW(F, Texts_FontDesc);
__COPY(name, F->name, 32); __COPY(name, F->name, 32);
_o_result = F; return F;
return _o_result;
} }
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas
static Texts_Piece Texts_ClonePiece (Texts_Piece p) static Texts_Piece Texts_ClonePiece (Texts_Piece p)
{ {
Texts_Piece _o_result;
Texts_Piece q = NIL; Texts_Piece q = NIL;
__NEW(q, Texts_PieceDesc); __NEW(q, Texts_PieceDesc);
__GUARDEQP(q, Texts_PieceDesc) = *p; __GUARDEQP(q, Texts_PieceDesc) = *p;
_o_result = q; return q;
return _o_result;
} }
static Texts_Elem Texts_CloneElem (Texts_Elem e) static Texts_Elem Texts_CloneElem (Texts_Elem e)
{ {
Texts_Elem _o_result;
Texts_CopyMsg msg; Texts_CopyMsg msg;
msg.e = NIL; msg.e = NIL;
(*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ);
_o_result = msg.e; return msg.e;
return _o_result;
} }
void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
Texts_Text Texts_ElemBase (Texts_Elem E) Texts_Text Texts_ElemBase (Texts_Elem E)
{ {
Texts_Text _o_result; return E->base;
_o_result = E->base;
return _o_result;
} }
int32 Texts_ElemPos (Texts_Elem E) int32 Texts_ElemPos (Texts_Elem E)
{ {
int32 _o_result;
Texts_Run u = NIL; Texts_Run u = NIL;
int32 pos; int32 pos;
u = E->base->head->next; u = E->base->head->next;
@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E)
pos = pos + u->len; pos = pos + u->len;
u = u->next; u = u->next;
} }
_o_result = pos; return pos;
return _o_result;
} }
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
int32 Texts_Pos (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ)
{ {
int32 _o_result; return (*R).org + (*R).off;
_o_result = (*R).org + (*R).off;
return _o_result;
} }
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)

View file

@ -317,14 +317,11 @@ void Files_Close (Files_File f)
int32 Files_Length (Files_File f) int32 Files_Length (Files_File f)
{ {
int32 _o_result; return f->len;
_o_result = f->len;
return _o_result;
} }
Files_File Files_New (CHAR *name, LONGINT name__len) Files_File Files_New (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
f->len = 0; f->len = 0;
f->pos = 0; f->pos = 0;
f->swapper = -1; f->swapper = -1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
CHAR ch; CHAR ch;
i = 0; i = 0;
@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
i += 1; i += 1;
ch = name[i]; ch = name[i];
} }
_o_result = ch == '/'; return ch == '/';
return _o_result;
} }
static Files_File Files_CacheEntry (Platform_FileIdentity identity) static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int16 i, error; int16 i, error;
f = Files_files; f = Files_files;
@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
f->identity = identity; f->identity = identity;
error = Platform_Size(f->fd, &f->len); error = Platform_Size(f->fd, &f->len);
} }
_o_result = f; return f;
return _o_result;
} }
f = f->next; f = f->next;
} }
_o_result = NIL; return NIL;
return _o_result;
} }
Files_File Files_Old (CHAR *name, LONGINT name__len) Files_File Files_Old (CHAR *name, LONGINT name__len)
{ {
Files_File _o_result;
Files_File f = NIL; Files_File f = NIL;
int32 fd; int32 fd;
int16 pos; int16 pos;
@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ);
f = Files_CacheEntry(identity); f = Files_CacheEntry(identity);
if (f != NIL) { if (f != NIL) {
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} else { } else {
__NEW(f, Files_FileDesc); __NEW(f, Files_FileDesc);
Heap_RegisterFinalizer((void*)f, Files_Finalize); Heap_RegisterFinalizer((void*)f, Files_Finalize);
@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->next = Files_files; f->next = Files_files;
Files_files = f; Files_files = f;
Heap_FileCount += 1; Heap_FileCount += 1;
_o_result = f;
__DEL(name); __DEL(name);
return _o_result; return f;
} }
} else if (dir[0] == 0x00) { } else if (dir[0] == 0x00) {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} else { } else {
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256); Files_ScanPath(&pos, (void*)dir, 256);
} }
} }
} else { } else {
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }
@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d)
int32 Files_Pos (Files_Rider *r, address *r__typ) int32 Files_Pos (Files_Rider *r, address *r__typ)
{ {
int32 _o_result; return (*r).org + (*r).offset;
_o_result = (*r).org + (*r).offset;
return _o_result;
} }
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
Files_File Files_Base (Files_Rider *r, address *r__typ) Files_File Files_Base (Files_Rider *r, address *r__typ)
{ {
Files_File _o_result; return (*r).buf->f;
_o_result = (*r).buf->f;
return _o_result;
} }
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
error = Platform_Rename((void*)old, old__len, (void*)new, new__len); error = Platform_Rename((void*)old, old__len, (void*)new, new__len);
if (!Platform_DifferentFilesystems(error)) { if (!Platform_DifferentFilesystems(error)) {
*res = error; *res = error;
__DEL(old);
__DEL(new);
return; return;
} else { } else {
error = Platform_OldRO((void*)old, old__len, &fdold); error = Platform_OldRO((void*)old, old__len, &fdold);
if (error != 0) { if (error != 0) {
*res = 2; *res = 2;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_New((void*)new, new__len, &fdnew); error = Platform_New((void*)new, new__len, &fdnew);
if (error != 0) { if (error != 0) {
error = Platform_Close(fdold); error = Platform_Close(fdold);
*res = 3; *res = 3;
__DEL(old);
__DEL(new);
return; return;
} }
error = Platform_Read(fdold, (address)buf, 4096, &n); error = Platform_Read(fdold, (address)buf, 4096, &n);

View file

@ -127,7 +127,6 @@ void Heap_Unlock (void)
SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
{ {
SYSTEM_PTR _o_result;
Heap_Module m; Heap_Module m;
if (__STRCMP(name, "Heap") == 0) { if (__STRCMP(name, "Heap") == 0) {
__SYSNEW(m, 64); __SYSNEW(m, 64);
@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
m->enumPtrs = enumPtrs; m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(address)Heap_modules; m->next = (Heap_Module)(address)Heap_modules;
Heap_modules = (SYSTEM_PTR)m; Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m; return (void*)m;
return _o_result;
} }
void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m)
static int64 Heap_NewChunk (int64 blksz) static int64 Heap_NewChunk (int64 blksz)
{ {
int64 _o_result;
int64 chnk; int64 chnk;
chnk = Heap_OSAllocate(blksz + 24); chnk = Heap_OSAllocate(blksz + 24);
if (chnk != 0) { if (chnk != 0) {
@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz)
Heap_bigBlocks = chnk + 24; Heap_bigBlocks = chnk + 24;
Heap_heapsize += blksz; Heap_heapsize += blksz;
} }
_o_result = chnk; return chnk;
return _o_result;
} }
static void Heap_ExtendHeap (int64 blksz) static void Heap_ExtendHeap (int64 blksz)
@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz)
SYSTEM_PTR Heap_NEWREC (int64 tag) SYSTEM_PTR Heap_NEWREC (int64 tag)
{ {
SYSTEM_PTR _o_result;
int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
new = Heap_NEWREC(tag); new = Heap_NEWREC(tag);
} }
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} else { } else {
Heap_Unlock(); Heap_Unlock();
_o_result = NIL; return NIL;
return _o_result;
} }
} }
__GET(adr + 8, t, int64); __GET(adr + 8, t, int64);
@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
__PUT(adr + 16, 0, int64); __PUT(adr + 16, 0, int64);
Heap_allocated += blksz; Heap_allocated += blksz;
Heap_Unlock(); Heap_Unlock();
_o_result = (SYSTEM_PTR)(address)(adr + 8); return (SYSTEM_PTR)(address)(adr + 8);
return _o_result;
} }
SYSTEM_PTR Heap_NEWBLK (int64 size) SYSTEM_PTR Heap_NEWBLK (int64 size)
{ {
SYSTEM_PTR _o_result;
int64 blksz, tag; int64 blksz, tag;
SYSTEM_PTR new; SYSTEM_PTR new;
Heap_Lock(); Heap_Lock();
@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size)
__PUT(tag + 8, -8, int64); __PUT(tag + 8, -8, int64);
__PUT((int64)(address)new - 8, tag, int64); __PUT((int64)(address)new - 8, tag, int64);
Heap_Unlock(); Heap_Unlock();
_o_result = new; return new;
return _o_result;
} }
static void Heap_Mark (int64 q) static void Heap_Mark (int64 q)

View file

@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
{ {
Modules_Module _o_result;
Modules_Module m = NIL; Modules_Module m = NIL;
CHAR bodyname[64]; CHAR bodyname[64];
Modules_Command body; Modules_Command body;
@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
} }
_o_result = m;
__DEL(name); __DEL(name);
return _o_result; return m;
} }
Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len)
{ {
Modules_Command _o_result;
Modules_Cmd c = NIL; Modules_Cmd c = NIL;
__DUP(name, name__len, CHAR); __DUP(name, name__len, CHAR);
c = mod->cmds; c = mod->cmds;
@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
if (c != NIL) { if (c != NIL) {
Modules_res = 0; Modules_res = 0;
Modules_resMsg[0] = 0x00; Modules_resMsg[0] = 0x00;
_o_result = c->cmd;
__DEL(name); __DEL(name);
return _o_result; return c->cmd;
} else { } else {
Modules_res = 2; Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11); __MOVE(" command \"", Modules_resMsg, 11);
@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name); __DEL(name);
return _o_result; return NIL;
} }
__RETCHK; __RETCHK;
} }

View file

@ -74,7 +74,6 @@ static void OPB_err (int16 n)
OPT_Node OPB_NewLeaf (OPT_Object obj) OPT_Node OPB_NewLeaf (OPT_Object obj)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
switch (obj->mode) { switch (obj->mode) {
case 1: case 1:
@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
} }
node->obj = obj; node->obj = obj;
node->typ = obj->typ; node->typ = obj->typ;
_o_result = node; return node;
return _o_result;
} }
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
static int16 OPB_BoolToInt (BOOLEAN b) static int16 OPB_BoolToInt (BOOLEAN b)
{ {
int16 _o_result;
if (b) { if (b) {
_o_result = 1; return 1;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
static BOOLEAN OPB_IntToBool (int64 i) static BOOLEAN OPB_IntToBool (int64 i)
{ {
BOOLEAN _o_result; return i != 0;
_o_result = i != 0;
return _o_result;
} }
OPT_Node OPB_NewBoolConst (BOOLEAN boolval) OPT_Node OPB_NewBoolConst (BOOLEAN boolval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_booltyp; x->typ = OPT_booltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = OPB_BoolToInt(boolval); x->conval->intval = OPB_BoolToInt(boolval);
_o_result = x; return x;
return _o_result;
} }
void OPB_OptIf (OPT_Node *x) void OPB_OptIf (OPT_Node *x)
@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x)
OPT_Node OPB_Nil (void) OPT_Node OPB_Nil (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_niltyp; x->typ = OPT_niltyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = 0; x->conval->intval = 0;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_EmptySet (void) OPT_Node OPB_EmptySet (void)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->typ = OPT_settyp; x->typ = OPT_settyp;
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->setval = 0x0; x->conval->setval = 0x0;
_o_result = x; return x;
return _o_result;
} }
static void OPB_SetIntType (OPT_Node node) static void OPB_SetIntType (OPT_Node node)
@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node)
OPT_Node OPB_NewIntConst (int64 intval) OPT_Node OPB_NewIntConst (int64 intval)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->intval = intval; x->conval->intval = intval;
OPB_SetIntType(x); OPB_SetIntType(x);
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
x->conval->realval = realval; x->conval->realval = realval;
x->typ = typ; x->typ = typ;
x->conval->intval = -1; x->conval->intval = -1;
_o_result = x; return x;
return _o_result;
} }
OPT_Node OPB_NewString (OPS_String str, int64 len) OPT_Node OPB_NewString (OPS_String str, int64 len)
{ {
OPT_Node _o_result;
OPT_Node x = NIL; OPT_Node x = NIL;
x = OPT_NewNode(7); x = OPT_NewNode(7);
x->conval = OPT_NewConst(); x->conval = OPT_NewConst();
@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len)
x->conval->intval2 = OPM_Longint(len); x->conval->intval2 = OPM_Longint(len);
x->conval->ext = OPT_NewExt(); x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, 256); __COPY(str, *x->conval->ext, 256);
_o_result = x; return x;
return _o_result;
} }
static void OPB_CharToString (OPT_Node n) static void OPB_CharToString (OPT_Node n)
@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN OPB_NotVar (OPT_Node x) static BOOLEAN OPB_NotVar (OPT_Node x)
{ {
BOOLEAN _o_result; return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
_o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7));
return _o_result;
} }
void OPB_DeRef (OPT_Node *x) void OPB_DeRef (OPT_Node *x)
@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y)
static int64 OPB_log (int64 x) static int64 OPB_log (int64 x)
{ {
int64 _o_result;
OPB_exp = 0; OPB_exp = 0;
if (x > 0) { if (x > 0) {
while (!__ODD(x)) { while (!__ODD(x)) {
@ -497,8 +475,7 @@ static int64 OPB_log (int64 x)
OPB_exp += 1; OPB_exp += 1;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(11); node = OPT_NewNode(11);
node->subcl = op; node->subcl = op;
node->typ = typ; node->typ = typ;
node->left = z; node->left = z;
_o_result = node; return node;
return _o_result;
} }
void OPB_MOp (int8 op, OPT_Node *x) void OPB_MOp (int8 op, OPT_Node *x)
@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void) static int16 ConstCmp__14 (void)
{ {
int16 _o_result;
int16 res; int16 res;
switch (*ConstOp__13_s->f) { switch (*ConstOp__13_s->f) {
case 0: case 0:
@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void)
break; break;
} }
(*ConstOp__13_s->x)->typ = OPT_booltyp; (*ConstOp__13_s->x)->typ = OPT_booltyp;
_o_result = res; return res;
return _o_result;
} }
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
{ {
BOOLEAN _o_result;
BOOLEAN ok, xCharArr, yCharArr; BOOLEAN ok, xCharArr, yCharArr;
xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8;
yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8;
@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
OPB_Index(&*x, OPB_NewIntConst(0)); OPB_Index(&*x, OPB_NewIntConst(0));
} }
} }
_o_result = ok; return ok;
return _o_result;
} }
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
node = OPT_NewNode(class); node = OPT_NewNode(class);
node->subcl = subcl; node->subcl = subcl;
node->left = left; node->left = left;
node->right = right; node->right = right;
_o_result = node; return node;
return _o_result;
} }
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)

View file

@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static int16 OPC_Length (CHAR *s, LONGINT s__len) static int16 OPC_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
i = 0; i = 0;
while (s[__X(i, s__len)] != 0x00) { while (s[__X(i, s__len)] != 0x00) {
i += 1; i += 1;
} }
_o_result = i; return i;
return _o_result;
} }
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i, h; int16 i, h;
i = 0; i = 0;
h = 0; h = 0;
@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
h = 3 * h + (int16)s[__X(i, s__len)]; h = 3 * h + (int16)s[__X(i, s__len)];
i += 1; i += 1;
} }
_o_result = (int)__MOD(h, 105); return (int)__MOD(h, 105);
return _o_result;
} }
void OPC_Ident (OPT_Object obj) void OPC_Ident (OPT_Object obj)
@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ)
static BOOLEAN OPC_Undefined (OPT_Object obj) static BOOLEAN OPC_Undefined (OPT_Object obj)
{ {
BOOLEAN _o_result; return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
_o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2);
return _o_result;
} }
static void OPC_DeclareBase (OPT_Object dcl) static void OPC_DeclareBase (OPT_Object dcl)
@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
int32 OPC_NofPtrs (OPT_Struct typ) int32 OPC_NofPtrs (OPT_Struct typ)
{ {
int32 _o_result;
OPT_Object fld = NIL; OPT_Object fld = NIL;
OPT_Struct btyp = NIL; OPT_Struct btyp = NIL;
int32 n; int32 n;
if ((typ->form == 11 && typ->sysflag == 0)) { if ((typ->form == 11 && typ->sysflag == 0)) {
_o_result = 1; return 1;
return _o_result;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp != NIL) { if (btyp != NIL) {
@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ)
} }
fld = fld->link; fld = fld->link;
} }
_o_result = n; return n;
return _o_result;
} else if (typ->comp == 2) { } else if (typ->comp == 2) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
n = typ->n; n = typ->n;
@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ)
n = btyp->n * n; n = btyp->n * n;
btyp = btyp->BaseTyp; btyp = btyp->BaseTyp;
} }
_o_result = OPC_NofPtrs(btyp) * n; return OPC_NofPtrs(btyp) * n;
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Object OPC_BaseTProc (OPT_Object obj)
{ {
OPT_Object _o_result;
OPT_Struct typ = NIL, base = NIL; OPT_Struct typ = NIL, base = NIL;
int32 mno; int32 mno;
typ = obj->link->typ; typ = obj->link->typ;
@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj)
base = typ->BaseTyp; base = typ->BaseTyp;
} }
OPT_FindField(obj->name, typ, &obj); OPT_FindField(obj->name, typ, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{ {
BOOLEAN _o_result;
int16 i; int16 i;
BOOLEAN r;
__DUP(y, y__len, CHAR); __DUP(y, y__len, CHAR);
i = 0; i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
i += 1; i += 1;
} }
r = y[__X(i, y__len)] == 0x00;
_o_result = r;
__DEL(y); __DEL(y);
return _o_result; return y[__X(i, y__len)] == 0x00;
} }
static void OPC_CProcDefs (OPT_Object obj, int16 vis) static void OPC_CProcDefs (OPT_Object obj, int16 vis)
@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc)
} }
OPC_ProcHeader(proc, 1); OPC_ProcHeader(proc, 1);
OPC_BegBlk(); OPC_BegBlk();
if (proc->typ != OPT_notyp) {
OPC_BegStat();
OPC_Ident(proc->typ->strobj);
OPM_WriteString((CHAR*)" _o_result;", 12);
OPM_WriteLn();
}
scope = proc->scope; scope = proc->scope;
OPC_IdentList(scope->scope, 0); OPC_IdentList(scope->scope, 0);
if (!scope->leaf) { if (!scope->leaf) {

View file

@ -124,33 +124,25 @@ void OPM_LogWLn (void)
int64 OPM_SignedMaximum (int32 bytecount) int64 OPM_SignedMaximum (int32 bytecount)
{ {
int64 _o_result;
int64 result; int64 result;
result = 1; result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
_o_result = result - 1; return result - 1;
return _o_result;
} }
int64 OPM_SignedMinimum (int32 bytecount) int64 OPM_SignedMinimum (int32 bytecount)
{ {
int64 _o_result; return -OPM_SignedMaximum(bytecount) - 1;
_o_result = -OPM_SignedMaximum(bytecount) - 1;
return _o_result;
} }
int32 OPM_Longint (int64 n) int32 OPM_Longint (int64 n)
{ {
int32 _o_result; return __VAL(int32, n);
_o_result = __VAL(int32, n);
return _o_result;
} }
int16 OPM_Integer (int64 n) int16 OPM_Integer (int64 n)
{ {
int16 _o_result; return __VAL(int16, n);
_o_result = __VAL(int16, n);
return _o_result;
} }
static void OPM_ScanOptions (CHAR *s, LONGINT s__len) static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
BOOLEAN OPM_OpenPar (void) BOOLEAN OPM_OpenPar (void)
{ {
BOOLEAN _o_result;
CHAR s[256]; CHAR s[256];
if (Platform_ArgCount == 1) { if (Platform_ArgCount == 1) {
OPM_LogWLn(); OPM_LogWLn();
@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr(Configuration_versionLong, 75); OPM_LogWStr(Configuration_versionLong, 75);
OPM_LogW('.'); OPM_LogW('.');
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68);
OPM_LogWLn(); OPM_LogWLn();
@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWStr((CHAR*)"Options:", 9);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWStr((CHAR*)" Run time safety", 18);
@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58);
@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn(); OPM_LogWLn();
_o_result = 0; return 0;
return _o_result;
} else { } else {
OPM_AddressSize = 8; OPM_AddressSize = 8;
OPM_GetAlignment(&OPM_Alignment); OPM_GetAlignment(&OPM_Alignment);
@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void)
OPM_GlobalAlignment = OPM_Alignment; OPM_GlobalAlignment = OPM_Alignment;
__COPY(OPM_Model, OPM_GlobalModel, 10); __COPY(OPM_Model, OPM_GlobalModel, 10);
OPM_GlobalOptions = OPM_Options; OPM_GlobalOptions = OPM_Options;
_o_result = 1; return 1;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch)
int32 OPM_SymRInt (void) int32 OPM_SymRInt (void)
{ {
int32 _o_result;
int32 k; int32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
_o_result = k; return k;
return _o_result;
} }
int64 OPM_SymRInt64 (void) int64 OPM_SymRInt64 (void)
{ {
int64 _o_result;
int64 k; int64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
_o_result = k; return k;
return _o_result;
} }
void OPM_SymRSet (uint64 *s) void OPM_SymRSet (uint64 *s)
@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
BOOLEAN OPM_eofSF (void) BOOLEAN OPM_eofSF (void)
{ {
BOOLEAN _o_result; return OPM_oldSF.eof;
_o_result = OPM_oldSF.eof;
return _o_result;
} }
void OPM_SymWCh (CHAR ch) void OPM_SymWCh (CHAR ch)

View file

@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
{ {
BOOLEAN _o_result;
if ((b->form == 11 && x->form == 11)) { if ((b->form == 11 && x->form == 11)) {
b = b->BaseTyp; b = b->BaseTyp;
x = x->BaseTyp; x = x->BaseTyp;
@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b)
x = x->BaseTyp; x = x->BaseTyp;
} while (!(x == NIL || x == b)); } while (!(x == NIL || x == b));
} }
_o_result = x == b; return x == b;
return _o_result;
} }
static struct ProcedureDeclaration__16 { static struct ProcedureDeclaration__16 {

View file

@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e);
static LONGREAL Ten__9 (int16 e) static LONGREAL Ten__9 (int16 e)
{ {
LONGREAL _o_result;
LONGREAL x, p; LONGREAL x, p;
x = (LONGREAL)1; x = (LONGREAL)1;
p = (LONGREAL)10; p = (LONGREAL)10;
@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e)
p = p * p; p = p * p;
} }
} }
_o_result = x; return x;
return _o_result;
} }
static int16 Ord__7 (CHAR ch, BOOLEAN hex) static int16 Ord__7 (CHAR ch, BOOLEAN hex)
{ {
int16 _o_result;
if (ch <= '9') { if (ch <= '9') {
_o_result = (int16)ch - 48; return (int16)ch - 48;
return _o_result;
} else if (hex) { } else if (hex) {
_o_result = ((int16)ch - 65) + 10; return ((int16)ch - 65) + 10;
return _o_result;
} else { } else {
OPS_err(2); OPS_err(2);
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -324,6 +318,7 @@ void OPS_Get (int8 *sym)
while (OPS_ch <= ' ') { while (OPS_ch <= ' ') {
if (OPS_ch == 0x00) { if (OPS_ch == 0x00) {
*sym = 64; *sym = 64;
Get__1_s = _s.lnk;
return; return;
} else { } else {
OPM_Get(&OPS_ch); OPM_Get(&OPS_ch);

View file

@ -179,7 +179,6 @@ static void OPT_err (int16 n)
int16 OPT_IntSize (int64 n) int16 OPT_IntSize (int64 n)
{ {
int16 _o_result;
int16 bytes; int16 bytes;
if (n < 0) { if (n < 0) {
n = -(n + 1); n = -(n + 1);
@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n)
while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) {
bytes += 1; bytes += 1;
} }
_o_result = bytes; return bytes;
return _o_result;
} }
OPT_Struct OPT_IntType (int32 size) OPT_Struct OPT_IntType (int32 size)
{ {
OPT_Struct _o_result;
if (size <= OPT_int8typ->size) { if (size <= OPT_int8typ->size) {
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
if (size <= OPT_int16typ->size) { if (size <= OPT_int16typ->size) {
_o_result = OPT_int16typ; return OPT_int16typ;
return _o_result;
} }
if (size <= OPT_int32typ->size) { if (size <= OPT_int32typ->size) {
_o_result = OPT_int32typ; return OPT_int32typ;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} }
OPT_Struct OPT_SetType (int32 size) OPT_Struct OPT_SetType (int32 size)
{ {
OPT_Struct _o_result;
if (size == OPT_set32typ->size) { if (size == OPT_set32typ->size) {
_o_result = OPT_set32typ; return OPT_set32typ;
return _o_result;
} }
_o_result = OPT_set64typ; return OPT_set64typ;
return _o_result;
} }
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
{ {
OPT_Struct _o_result;
int16 i; int16 i;
__ASSERT(x->form == 4, 0); __ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0); __ASSERT(dir == 1 || dir == -1, 0);
if (dir > 0) { if (dir > 0) {
if (x->size < OPT_sinttyp->size) { if (x->size < OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
if (x->size < OPT_inttyp->size) { if (x->size < OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size < OPT_linttyp->size) { if (x->size < OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
_o_result = OPT_int64typ; return OPT_int64typ;
return _o_result;
} else { } else {
if (x->size > OPT_linttyp->size) { if (x->size > OPT_linttyp->size) {
_o_result = OPT_linttyp; return OPT_linttyp;
return _o_result;
} }
if (x->size > OPT_inttyp->size) { if (x->size > OPT_inttyp->size) {
_o_result = OPT_inttyp; return OPT_inttyp;
return _o_result;
} }
if (x->size > OPT_sinttyp->size) { if (x->size > OPT_sinttyp->size) {
_o_result = OPT_sinttyp; return OPT_sinttyp;
return _o_result;
} }
_o_result = OPT_int8typ; return OPT_int8typ;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base)
int32 OPT_SizeAlignment (int32 size) int32 OPT_SizeAlignment (int32 size)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (size < OPM_Alignment) { if (size < OPM_Alignment) {
alignment = 1; alignment = 1;
@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size)
} else { } else {
alignment = OPM_Alignment; alignment = OPM_Alignment;
} }
_o_result = alignment; return alignment;
return _o_result;
} }
int32 OPT_BaseAlignment (OPT_Struct typ) int32 OPT_BaseAlignment (OPT_Struct typ)
{ {
int32 _o_result;
int32 alignment; int32 alignment;
if (typ->form == 13) { if (typ->form == 13) {
if (typ->comp == 4) { if (typ->comp == 4) {
@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
} else { } else {
alignment = OPT_SizeAlignment(typ->size); alignment = OPT_SizeAlignment(typ->size);
} }
_o_result = alignment; return alignment;
return _o_result;
} }
void OPT_TypSize (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ)
@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ)
OPT_Const OPT_NewConst (void) OPT_Const OPT_NewConst (void)
{ {
OPT_Const _o_result;
OPT_Const const_ = NIL; OPT_Const const_ = NIL;
__NEW(const_, OPT_ConstDesc); __NEW(const_, OPT_ConstDesc);
_o_result = const_; return const_;
return _o_result;
} }
OPT_Object OPT_NewObj (void) OPT_Object OPT_NewObj (void)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
__NEW(obj, OPT_ObjDesc); __NEW(obj, OPT_ObjDesc);
_o_result = obj; return obj;
return _o_result;
} }
OPT_Struct OPT_NewStr (int8 form, int8 comp) OPT_Struct OPT_NewStr (int8 form, int8 comp)
{ {
OPT_Struct _o_result;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc); __NEW(typ, OPT_StrDesc);
typ->form = form; typ->form = form;
@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
} }
typ->size = -1; typ->size = -1;
typ->BaseTyp = OPT_undftyp; typ->BaseTyp = OPT_undftyp;
_o_result = typ; return typ;
return _o_result;
} }
OPT_Node OPT_NewNode (int8 class) OPT_Node OPT_NewNode (int8 class)
{ {
OPT_Node _o_result;
OPT_Node node = NIL; OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc); __NEW(node, OPT_NodeDesc);
node->class = class; node->class = class;
_o_result = node; return node;
return _o_result;
} }
OPT_ConstExt OPT_NewExt (void) OPT_ConstExt OPT_NewExt (void)
{ {
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL; OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256)));
_o_result = ext; return ext;
return _o_result;
} }
void OPT_OpenScope (int8 level, OPT_Object owner) void OPT_OpenScope (int8 level, OPT_Object owner)
@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void) static OPT_Object OPT_InFld (void)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void)
obj->vis = 0; obj->vis = 0;
obj->adr = OPM_SymRInt(); obj->adr = OPM_SymRInt();
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Object OPT_InTProc (int8 mno) static OPT_Object OPT_InTProc (int8 mno)
{ {
OPT_Object _o_result;
int32 tag; int32 tag;
OPT_Object obj = NIL; OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag; tag = OPT_impCtxt.nextTag;
@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno)
obj->vis = 0; obj->vis = 0;
obj->adr = __ASHL(OPM_SymRInt(), 16); obj->adr = __ASHL(OPM_SymRInt(), 16);
} }
_o_result = obj; return obj;
return _o_result;
} }
static OPT_Struct OPT_InTyp (int32 tag) static OPT_Struct OPT_InTyp (int32 tag)
{ {
OPT_Struct _o_result;
if (tag == 4) { if (tag == 4) {
_o_result = OPT_IntType(OPM_SymRInt()); return OPT_IntType(OPM_SymRInt());
return _o_result;
} else if (tag == 7) { } else if (tag == 7) {
_o_result = OPT_SetType(OPM_SymRInt()); return OPT_SetType(OPM_SymRInt());
return _o_result;
} else { } else {
_o_result = OPT_impCtxt.ref[__X(tag, 255)]; return OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ)
static OPT_Object OPT_InObj (int8 mno) static OPT_Object OPT_InObj (int8 mno)
{ {
OPT_Object _o_result;
int16 i, s; int16 i, s;
CHAR ch; CHAR ch;
OPT_Object obj = NIL, old = NIL; OPT_Object obj = NIL, old = NIL;
@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno)
} }
} }
} }
_o_result = obj; return obj;
return _o_result;
} }
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)

View file

@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope)
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
{ {
int16 _o_result;
switch (class) { switch (class) {
case 7: case 0: case 2: case 4: case 9: case 7: case 0: case 2: case 4: case 9:
case 13: case 13:
_o_result = 10; return 10;
return _o_result;
break; break;
case 5: case 5:
if (__IN(3, OPM_Options, 32)) { if (__IN(3, OPM_Options, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 1: case 1:
if (__IN(comp, 0x0c, 32)) { if (__IN(comp, 0x0c, 32)) {
_o_result = 10; return 10;
return _o_result;
} else { } else {
_o_result = 9; return 9;
return _o_result;
} }
break; break;
case 3: case 3:
_o_result = 9; return 9;
return _o_result;
break; break;
case 11: case 11:
switch (subclass) { switch (subclass) {
case 33: case 7: case 24: case 29: case 20: case 33: case 7: case 24: case 29: case 20:
_o_result = 9; return 9;
return _o_result;
break; break;
case 16: case 21: case 22: case 23: case 25: case 16: case 21: case 22: case 23: case 25:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55);
@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
switch (subclass) { switch (subclass) {
case 1: case 1:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 2: case 2:
if (form == 7) { if (form == 7) {
_o_result = 3; return 3;
return _o_result;
} else { } else {
_o_result = 8; return 8;
return _o_result;
} }
break; break;
case 3: case 4: case 3: case 4:
_o_result = 10; return 10;
return _o_result;
break; break;
case 6: case 6:
if (form == 7) { if (form == 7) {
_o_result = 2; return 2;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 7: case 7:
if (form == 7) { if (form == 7) {
_o_result = 4; return 4;
return _o_result;
} else { } else {
_o_result = 7; return 7;
return _o_result;
} }
break; break;
case 11: case 12: case 13: case 14: case 11: case 12: case 13: case 14:
_o_result = 6; return 6;
return _o_result;
break; break;
case 9: case 10: case 9: case 10:
_o_result = 5; return 5;
return _o_result;
break; break;
case 5: case 5:
_o_result = 1; return 1;
return _o_result;
break; break;
case 8: case 8:
_o_result = 0; return 0;
return _o_result;
break; break;
case 19: case 15: case 17: case 18: case 26: case 19: case 15: case 17: case 18: case 26:
case 27: case 28: case 27: case 28:
_o_result = 10; return 10;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55);
@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
} }
break; break;
case 10: case 10:
_o_result = 10; return 10;
return _o_result;
break; break;
case 8: case 6: case 8: case 6:
_o_result = 12; return 12;
return _o_result;
break; break;
default: default:
OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43);
@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim)
static BOOLEAN OPV_SideEffects (OPT_Node n) static BOOLEAN OPV_SideEffects (OPT_Node n)
{ {
BOOLEAN _o_result;
if (n != NIL) { if (n != NIL) {
_o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right);
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
static OPT_Object OPV_SuperProc (OPT_Node n) static OPT_Object OPV_SuperProc (OPT_Node n)
{ {
OPT_Object _o_result;
OPT_Object obj = NIL; OPT_Object obj = NIL;
OPT_Struct typ = NIL; OPT_Struct typ = NIL;
typ = n->right->typ; typ = n->right->typ;
@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }
OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj);
_o_result = obj; return obj;
return _o_result;
} }
static void OPV_expr (OPT_Node n, int16 prec) static void OPV_expr (OPT_Node n, int16 prec)
@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
{ {
BOOLEAN _o_result;
while ((n != NIL && n->class != 26)) { while ((n != NIL && n->class != 26)) {
n = n->link; n = n->link;
} }
_o_result = n == NIL; return n == NIL;
return _o_result;
} }
static void OPV_NewArr (OPT_Node d, OPT_Node x) static void OPV_NewArr (OPT_Node d, OPT_Node x)
@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
OPM_WriteString((CHAR*)"__ENDMOD", 9); OPM_WriteString((CHAR*)"__ENDMOD", 9);
} }
} else { } else {
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return", 7);
if (n->left != NIL) { if (n->left != NIL) {
OPM_WriteString((CHAR*)"_o_result = ", 13); OPM_Write(' ');
if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) {
OPM_WriteString((CHAR*)"(void*)", 8); OPM_WriteString((CHAR*)"(void*)", 8);
OPV_expr(n->left, 10); OPV_expr(n->left, 10);
} else { } else {
OPV_expr(n->left, -1); OPV_expr(n->left, -1);
} }
OPM_WriteString((CHAR*)";", 2);
OPM_WriteLn();
OPC_BegStat();
OPC_ExitProc(outerProc, 0, 0);
OPM_WriteString((CHAR*)"return _o_result", 17);
} else {
OPM_WriteString((CHAR*)"return", 7);
} }
} }
break; break;

View file

@ -56,14 +56,12 @@ void Out_Char (CHAR ch)
static int32 Out_Length (CHAR *s, LONGINT s__len) static int32 Out_Length (CHAR *s, LONGINT s__len)
{ {
int32 _o_result;
int32 l; int32 l;
l = 0; l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) { while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1; l += 1;
} }
_o_result = l; return l;
return _o_result;
} }
void Out_String (CHAR *str, LONGINT str__len) void Out_String (CHAR *str, LONGINT str__len)
@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
LONGREAL Out_Ten (int16 e) LONGREAL Out_Ten (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)

View file

@ -186,65 +186,47 @@ extern void Heap_InitHeap();
BOOLEAN Platform_TooManyFiles (int16 e) BOOLEAN Platform_TooManyFiles (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORTOOMANYOPENFILES();
_o_result = e == Platform_ERRORTOOMANYOPENFILES();
return _o_result;
} }
BOOLEAN Platform_NoSuchDirectory (int16 e) BOOLEAN Platform_NoSuchDirectory (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORPATHNOTFOUND();
_o_result = e == Platform_ERRORPATHNOTFOUND();
return _o_result;
} }
BOOLEAN Platform_DifferentFilesystems (int16 e) BOOLEAN Platform_DifferentFilesystems (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORNOTSAMEDEVICE();
_o_result = e == Platform_ERRORNOTSAMEDEVICE();
return _o_result;
} }
BOOLEAN Platform_Inaccessible (int16 e) BOOLEAN Platform_Inaccessible (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION();
_o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION();
return _o_result;
} }
BOOLEAN Platform_Absent (int16 e) BOOLEAN Platform_Absent (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND();
_o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND();
return _o_result;
} }
BOOLEAN Platform_TimedOut (int16 e) BOOLEAN Platform_TimedOut (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_ETIMEDOUT();
_o_result = e == Platform_ETIMEDOUT();
return _o_result;
} }
BOOLEAN Platform_ConnectionFailed (int16 e) BOOLEAN Platform_ConnectionFailed (int16 e)
{ {
BOOLEAN _o_result; return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
_o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
return _o_result;
} }
BOOLEAN Platform_Interrupted (int16 e) BOOLEAN Platform_Interrupted (int16 e)
{ {
BOOLEAN _o_result; return e == Platform_EINTR();
_o_result = e == Platform_EINTR();
return _o_result;
} }
int64 Platform_OSAllocate (int64 size) int64 Platform_OSAllocate (int64 size)
{ {
int64 _o_result; return Platform_allocate(size);
_o_result = Platform_allocate(size);
return _o_result;
} }
void Platform_OSFree (int64 address) void Platform_OSFree (int64 address)
@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int64 argvadr)
BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
{ {
BOOLEAN _o_result;
CHAR buf[4096]; CHAR buf[4096];
int16 res; int16 res;
__DUP(var, var__len, CHAR); __DUP(var, var__len, CHAR);
res = Platform_getenv(var, var__len, (void*)buf, 4096); res = Platform_getenv(var, var__len, (void*)buf, 4096);
if ((res > 0 && res < 4096)) { if ((res > 0 && res < 4096)) {
__COPY(buf, val, val__len); __COPY(buf, val, val__len);
_o_result = 1;
__DEL(var); __DEL(var);
return _o_result; return 1;
} else { } else {
_o_result = 0;
__DEL(var); __DEL(var);
return _o_result; return 0;
} }
__RETCHK; __RETCHK;
} }
@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val)
int16 Platform_ArgPos (CHAR *s, LONGINT s__len) int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int16 i; int16 i;
CHAR arg[256]; CHAR arg[256];
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
i += 1; i += 1;
Platform_GetArg(i, (void*)arg, 256); Platform_GetArg(i, (void*)arg, 256);
} }
_o_result = i;
__DEL(s); __DEL(s);
return _o_result; return i;
} }
void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d)
int32 Platform_Time (void) int32 Platform_Time (void)
{ {
int32 _o_result;
int32 ms; int32 ms;
ms = Platform_GetTickCount(); ms = Platform_GetTickCount();
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
} }
void Platform_Delay (int32 ms) void Platform_Delay (int32 ms)
@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
int16 Platform_System (CHAR *cmd, LONGINT cmd__len) int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{ {
int16 _o_result;
int16 result; int16 result;
__DUP(cmd, cmd__len, CHAR); __DUP(cmd, cmd__len, CHAR);
result = 127; result = 127;
@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
} }
Platform_cleanupProcess(); Platform_cleanupProcess();
} }
_o_result = __ASHL(result, 8);
__DEL(cmd); __DEL(cmd);
return _o_result; return __ASHL(result, 8);
} }
int16 Platform_Error (void) int16 Platform_Error (void)
{ {
int16 _o_result; return Platform_err();
_o_result = Platform_err();
return _o_result;
} }
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_openro(n, n__len); fd = Platform_openro(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_openrw(n, n__len); fd = Platform_openrw(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
{ {
int16 _o_result;
int32 fd; int32 fd;
fd = Platform_opennew(n, n__len); fd = Platform_opennew(n, n__len);
if (fd == Platform_invalidHandleValue()) { if (fd == Platform_invalidHandleValue()) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*h = fd; *h = fd;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Close (int32 h) int16 Platform_Close (int32 h)
{ {
int16 _o_result;
if (Platform_closeHandle(h) == 0) { if (Platform_closeHandle(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
Platform_byHandleFileInformation(); Platform_byHandleFileInformation();
if (Platform_getFileInformationByHandle(h) == 0) { if (Platform_getFileInformationByHandle(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
(*identity).volume = Platform_bhfiVsn(); (*identity).volume = Platform_bhfiVsn();
(*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexhigh = Platform_bhfiIndexHigh();
(*identity).indexlow = Platform_bhfiIndexLow(); (*identity).indexlow = Platform_bhfiIndexLow();
(*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimehigh = Platform_bhfiMtimeHigh();
(*identity).mtimelow = Platform_bhfiMtimeLow(); (*identity).mtimelow = Platform_bhfiMtimeLow();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
{ {
int16 _o_result;
int32 h; int32 h;
int16 e, i; int16 e, i;
__DUP(n, n__len, CHAR); __DUP(n, n__len, CHAR);
e = Platform_OldRO((void*)n, n__len, &h); e = Platform_OldRO((void*)n, n__len, &h);
if (e != 0) { if (e != 0) {
_o_result = e;
__DEL(n); __DEL(n);
return _o_result; return e;
} }
e = Platform_Identify(h, &*identity, identity__typ); e = Platform_Identify(h, &*identity, identity__typ);
i = Platform_Close(h); i = Platform_Close(h);
_o_result = e;
__DEL(n); __DEL(n);
return _o_result; return e;
} }
BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume);
_o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume);
return _o_result;
} }
BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2)
{ {
BOOLEAN _o_result; return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow);
_o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow);
return _o_result;
} }
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
int16 Platform_Size (int32 h, int32 *l) int16 Platform_Size (int32 h, int32 *l)
{ {
int16 _o_result;
Platform_largeInteger(); Platform_largeInteger();
if (Platform_getFileSize(h) == 0) { if (Platform_getFileSize(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
*l = Platform_liLongint(); *l = Platform_liLongint();
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n)
{ {
int16 _o_result;
int16 result; int16 result;
int32 lengthread; int32 lengthread;
result = Platform_readfile(h, p, l, &lengthread); result = Platform_readfile(h, p, l, &lengthread);
if (result == 0) { if (result == 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*n = lengthread; *n = lengthread;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
{ {
int16 _o_result;
int16 result; int16 result;
int32 lengthread; int32 lengthread;
result = Platform_readfile(h, (address)b, b__len, &lengthread); result = Platform_readfile(h, (address)b, b__len, &lengthread);
if (result == 0) { if (result == 0) {
*n = 0; *n = 0;
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
*n = lengthread; *n = lengthread;
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Write (int32 h, int64 p, int32 l) int16 Platform_Write (int32 h, int64 p, int32 l)
{ {
int16 _o_result;
if (Platform_writefile(h, p, l) == 0) { if (Platform_writefile(h, p, l) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Sync (int32 h) int16 Platform_Sync (int32 h)
{ {
int16 _o_result;
if (Platform_flushFileBuffers(h) == 0) { if (Platform_flushFileBuffers(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Seek (int32 h, int32 o, int16 r) int16 Platform_Seek (int32 h, int32 o, int16 r)
{ {
int16 _o_result;
int16 rc; int16 rc;
Platform_largeInteger(); Platform_largeInteger();
Platform_setFilePointerEx(h, o, r, &rc); Platform_setFilePointerEx(h, o, r, &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Truncate (int32 h, int32 limit) int16 Platform_Truncate (int32 h, int32 limit)
{ {
int16 _o_result;
int16 rc; int16 rc;
int32 oldpos; int32 oldpos;
Platform_largeInteger(); Platform_largeInteger();
Platform_getFilePos(h, &oldpos, &rc); Platform_getFilePos(h, &oldpos, &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
if (Platform_setEndOfFile(h) == 0) { if (Platform_setEndOfFile(h) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc);
if (rc == 0) { if (rc == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Unlink (CHAR *n, LONGINT n__len) int16 Platform_Unlink (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_deleteFile(n, n__len) == 0) { if (Platform_deleteFile(n, n__len) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }
int16 Platform_Chdir (CHAR *n, LONGINT n__len) int16 Platform_Chdir (CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
int16 r; int16 r;
r = Platform_setCurrentDirectory(n, n__len); r = Platform_setCurrentDirectory(n, n__len);
if (r == 0) { if (r == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} }
Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_getCurrentDirectory((void*)Platform_CWD, 4096);
_o_result = 0; return 0;
return _o_result;
} }
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{ {
int16 _o_result;
if (Platform_moveFile(o, o__len, n, n__len) == 0) { if (Platform_moveFile(o, o__len, n, n__len) == 0) {
_o_result = Platform_err(); return Platform_err();
return _o_result;
} else { } else {
_o_result = 0; return 0;
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i);
REAL Reals_Ten (int16 e) REAL Reals_Ten (int16 e)
{ {
REAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e)
power = power * power; power = power * power;
e = __ASHR(e, 1); e = __ASHR(e, 1);
} }
_o_result = r; return r;
return _o_result;
} }
LONGREAL Reals_TenL (int16 e) LONGREAL Reals_TenL (int16 e)
{ {
LONGREAL _o_result;
LONGREAL r, power; LONGREAL r, power;
r = (LONGREAL)1; r = (LONGREAL)1;
power = (LONGREAL)10; power = (LONGREAL)10;
@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e)
} }
e = __ASHR(e, 1); e = __ASHR(e, 1);
if (e <= 0) { if (e <= 0) {
_o_result = r; return r;
return _o_result;
} }
power = power * power; power = power * power;
} }
@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e)
int16 Reals_Expo (REAL x) int16 Reals_Expo (REAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 2, i, int16); __GET((address)&x + 2, i, int16);
_o_result = __MASK(__ASHR(i, 7), -256); return __MASK(__ASHR(i, 7), -256);
return _o_result;
} }
void Reals_SetExpo (REAL *x, int16 ex) void Reals_SetExpo (REAL *x, int16 ex)
@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex)
int16 Reals_ExpoL (LONGREAL x) int16 Reals_ExpoL (LONGREAL x)
{ {
int16 _o_result;
int16 i; int16 i;
__GET((address)&x + 6, i, int16); __GET((address)&x + 6, i, int16);
_o_result = __MASK(__ASHR(i, 4), -2048); return __MASK(__ASHR(i, 4), -2048);
return _o_result;
} }
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
static CHAR Reals_ToHex (int16 i) static CHAR Reals_ToHex (int16 i)
{ {
CHAR _o_result;
if (i < 10) { if (i < 10) {
_o_result = (CHAR)(i + 48); return (CHAR)(i + 48);
return _o_result;
} else { } else {
_o_result = (CHAR)(i + 55); return (CHAR)(i + 55);
return _o_result;
} }
__RETCHK; __RETCHK;
} }

View file

@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR
int16 Strings_Length (CHAR *s, LONGINT s__len) int16 Strings_Length (CHAR *s, LONGINT s__len)
{ {
int16 _o_result;
int32 i; int32 i;
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
i = 0; i = 0;
@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
i += 1; i += 1;
} }
if (i <= 32767) { if (i <= 32767) {
_o_result = (int16)i;
__DEL(s); __DEL(s);
return _o_result; return (int16)i;
} else { } else {
_o_result = 32767;
__DEL(s); __DEL(s);
return _o_result; return 32767;
} }
__RETCHK; __RETCHK;
} }
@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
} }
if (pos > n1) { if (pos > n1) {
Strings_Append(dest, dest__len, (void*)source, source__len); Strings_Append(dest, dest__len, (void*)source, source__len);
__DEL(source);
return; return;
} }
if ((pos + n2) < dest__len) { if ((pos + n2) < dest__len) {
@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
} }
if (pos >= len) { if (pos >= len) {
dest[0] = 0x00; dest[0] = 0x00;
__DEL(source);
return; return;
} }
i = 0; i = 0;
@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
{ {
int16 _o_result;
int16 n1, n2, i, j; int16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR); __DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len); n1 = Strings_Length(s, s__len);
n2 = Strings_Length(pattern, pattern__len); n2 = Strings_Length(pattern, pattern__len);
if (n2 == 0) { if (n2 == 0) {
_o_result = 0;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return 0;
} }
i = pos; i = pos;
while (i <= n1 - n2) { while (i <= n1 - n2) {
@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
j += 1; j += 1;
} }
if (j == n2) { if (j == n2) {
_o_result = i;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return i;
} }
} }
i += 1; i += 1;
} }
_o_result = -1;
__DEL(pattern); __DEL(pattern);
__DEL(s); __DEL(s);
return _o_result; return -1;
} }
void Strings_Cap (CHAR *s, LONGINT s__len) void Strings_Cap (CHAR *s, LONGINT s__len)
@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
{ {
BOOLEAN _o_result;
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {
_o_result = 0; return 0;
return _o_result;
} }
n -= 1; n -= 1;
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = n < 0; return n < 0;
return _o_result;
} }
while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { while ((m >= 0 && mask[__X(m, mask__len)] == '*')) {
m -= 1; m -= 1;
} }
if (m < 0) { if (m < 0) {
_o_result = 1; return 1;
return _o_result;
} }
while (n >= 0) { while (n >= 0) {
if (M__8(name, name__len, mask, mask__len, n, m)) { if (M__8(name, name__len, mask, mask__len, n, m)) {
_o_result = 1; return 1;
return _o_result;
} }
n -= 1; n -= 1;
} }
_o_result = 0; return 0;
return _o_result;
} }
BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len)
{ {
BOOLEAN _o_result;
struct Match__7 _s; struct Match__7 _s;
__DUP(string, string__len, CHAR); __DUP(string, string__len, CHAR);
__DUP(pattern, pattern__len, CHAR); __DUP(pattern, pattern__len, CHAR);
_s.lnk = Match__7_s; _s.lnk = Match__7_s;
Match__7_s = &_s; Match__7_s = &_s;
_o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
Match__7_s = _s.lnk; Match__7_s = _s.lnk;
__DEL(string); __DEL(string);
__DEL(pattern); __DEL(pattern);
return _o_result; return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1);
} }

View file

@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
{ {
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL; Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc); __NEW(F, Texts_FontDesc);
__COPY(name, F->name, 32); __COPY(name, F->name, 32);
_o_result = F; return F;
return _o_result;
} }
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas
static Texts_Piece Texts_ClonePiece (Texts_Piece p) static Texts_Piece Texts_ClonePiece (Texts_Piece p)
{ {
Texts_Piece _o_result;
Texts_Piece q = NIL; Texts_Piece q = NIL;
__NEW(q, Texts_PieceDesc); __NEW(q, Texts_PieceDesc);
__GUARDEQP(q, Texts_PieceDesc) = *p; __GUARDEQP(q, Texts_PieceDesc) = *p;
_o_result = q; return q;
return _o_result;
} }
static Texts_Elem Texts_CloneElem (Texts_Elem e) static Texts_Elem Texts_CloneElem (Texts_Elem e)
{ {
Texts_Elem _o_result;
Texts_CopyMsg msg; Texts_CopyMsg msg;
msg.e = NIL; msg.e = NIL;
(*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ);
_o_result = msg.e; return msg.e;
return _o_result;
} }
void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE)
Texts_Text Texts_ElemBase (Texts_Elem E) Texts_Text Texts_ElemBase (Texts_Elem E)
{ {
Texts_Text _o_result; return E->base;
_o_result = E->base;
return _o_result;
} }
int32 Texts_ElemPos (Texts_Elem E) int32 Texts_ElemPos (Texts_Elem E)
{ {
int32 _o_result;
Texts_Run u = NIL; Texts_Run u = NIL;
int32 pos; int32 pos;
u = E->base->head->next; u = E->base->head->next;
@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E)
pos = pos + u->len; pos = pos + u->len;
u = u->next; u = u->next;
} }
_o_result = pos; return pos;
return _o_result;
} }
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
int32 Texts_Pos (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ)
{ {
int32 _o_result; return (*R).org + (*R).off;
_o_result = (*R).org + (*R).off;
return _o_result;
} }
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)

View file

@ -275,7 +275,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn;
LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn;
LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn;
LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWStr(" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn;
LogWLn; LogWLn;
LogWStr("All options are off by default, except where noted above."); LogWLn; LogWStr("All options are off by default, except where noted above."); LogWLn;
LogWStr("Initial options specify defaults for all files."); LogWLn; LogWStr("Initial options specify defaults for all files."); LogWLn;

View file

@ -14,8 +14,8 @@
changes="0" changes="0"
for f in $1/*; do for f in $1/*; do
fn=$(basename $f) fn=$(basename $f)
egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old
egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new
if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then
echo "" echo ""
echo "" echo ""