diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 260915fb..e86ee126 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4ce28c47..076eb5a8 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c318921f..733b53ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Size (int64 h, address *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int32 Platform_Size (int64 h, address *l) { int32 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index e4145b85..97c6cb2a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Size (int64 h, address *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int64 Platform_Time (void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8a36bd2f..2e0565e9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3c273102..4b2bb492 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 23f25bda..84cb998f 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ea935dee..8336cb0e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/makefile b/makefile index 7f335f34..37fa64a0 100644 --- a/makefile +++ b/makefile @@ -262,21 +262,21 @@ bootstrap: configuration @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 6b35a090..bf1c9a1d 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; error: Platform.ErrorCode; + VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode; BEGIN Flush(); error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END diff --git a/src/system/Files.Mod b/src/system/Files.Mod index fb9fc421..388b3a95 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -34,14 +34,16 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Buffer = POINTER TO BufDesc; FileDesc = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - identity: Platform.FileIdentity; - fd-: Platform.FileHandle; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER; - next: File; + workName: FileName; + registerName: FileName; + tempFile: BOOLEAN; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper: INTEGER; + state: INTEGER; + next: File; END; BufDesc = RECORD @@ -52,11 +54,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files data: ARRAY bufsize OF SYSTEM.BYTE END; - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org: LONGINT; + offset: LONGINT END; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 78daad35..a6e5d399 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; +PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN @@ -358,7 +358,7 @@ BEGIN END MTimeAsClock; -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode; BEGIN structstats; IF fstat(h) < 0 THEN RETURN err() END; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index cd535c97..c000b68b 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -379,6 +379,7 @@ void writeMakeParameters() { fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); fprintf(fd, "INTSIZE=%d\n", intsize); + fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 9e9dec60..a56bebea 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -97,6 +97,7 @@ translate: @printf "\nmake translate - translating compiler source from Oberon to C:\n" @printf " PLATFORM: %s\n" $(PLATFORM) @printf " INTSIZE: %s\n" $(INTSIZE) + @printf " MODEL: %s\n" $(MODEL) @printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ALIGNMENT: %s\n" $(ALIGNMENT) @mkdir -p $(BUILDDIR)