diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 41ad5883..58a4ec95 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f5aabe8a..34a403f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 70e9a7e2..bb971366 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 3a575916..01a8d9ef 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4135c1d4..17323792 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7637b515..6e34dddd 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,8 +263,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -273,17 +273,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -301,10 +301,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -614,7 +614,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -675,52 +675,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -734,9 +734,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -747,11 +747,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; @@ -783,7 +783,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 0fee3539..ca58fbe8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 3d09ab84..01806847 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5b20dd10..a0e79aca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 85814163..fdaec6b0 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 13bb2453..273d1182 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -253,7 +253,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -280,8 +280,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -290,17 +290,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -318,10 +318,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -334,8 +334,8 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) { - *d = (__ASHL((int)(int)__MOD(ye, 100), 9) + __ASHL((int)(mo + 1), 5)) + (int)da; - *t = (__ASHL((int)ho, 12) + __ASHL((int)mi, 6)) + (int)se; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } void Platform_GetClock (LONGINT *t, LONGINT *d) @@ -349,14 +349,14 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; ms = Platform_GetTickCount(); - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -664,7 +664,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -703,7 +703,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -719,37 +719,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -763,9 +763,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -776,11 +776,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; @@ -812,7 +812,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 8bb15073..d0a62b87 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 332ebd52..af2ecbd7 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4fa9852c..5f7d65a2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a0a4c4f3..fa7db0e9 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 679e8b8d..f66fdf2c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -254,7 +254,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -281,8 +281,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -291,17 +291,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -319,10 +319,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -357,7 +357,7 @@ LONGINT Platform_Time (void) void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -665,7 +665,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -720,37 +720,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -764,9 +764,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -777,11 +777,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; @@ -813,7 +813,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index aa08a76c..45566c5d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index b8244fd3..ea629ba1 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1260,14 +1260,30 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1("__HALT(#)", n) END Halt; + PROCEDURE IntLiteral*(n, size: LONGINT); + BEGIN + IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN + CASE size OF + |2: OPM.WriteString("((SYSTEM_INT16)("); + |4: OPM.WriteString("((SYSTEM_INT32)("); + |8: OPM.WriteString("((SYSTEM_INT64)("); + ELSE OPM.LogWStr("Unhandled case in OPC.IntLiteral, size = "); OPM.LogWNum(size,1); OPM.LogWLn; + END; + OPM.WriteInt(n); + OPM.WriteString("))") + ELSE + OPM.WriteInt(n) + END + END IntLiteral; + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); BEGIN IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); + WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 07b5b89f..10ee8ebb 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -74,6 +74,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; + (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + CIntSize* = 4; + CIntMax* = 7FFFFFFFH; + CIntMin* = -CIntMax - 1; + + SFext = ".sym"; (* symbol file extension *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index efaac954..4b1eda69 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1219,7 +1219,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp); +(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) + EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index a3e2272d..997fdccb 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -295,10 +295,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END Entier; - PROCEDURE SizeCast(size: LONGINT); + PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF size <= 4 THEN OPM.WriteString("(int)") - ELSE OPM.WriteString("(SYSTEM_INT64)") + IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + CASE to OF + |1: OPM.WriteString("(SYSTEM_INT8)"); + |2: OPM.WriteString("(SYSTEM_INT16)"); + |4: OPM.WriteString("(SYSTEM_INT32)"); + |8: OPM.WriteString("(SYSTEM_INT64)"); + ELSE OPM.LogWStr("Unhandled case in OPC.SizeCast, to = "); OPM.LogWNum(to,1); OPM.LogWLn; + END END END SizeCast; @@ -312,8 +318,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) ELSE - IF newtype.size # n.typ.size THEN SizeCast(newtype.size) END; - Entier(n, 9) + SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); @@ -443,6 +448,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF prec > designPrec THEN OPM.Write(CloseParen) END END design; + PROCEDURE ParIntLiteral(n, size: LONGINT); + BEGIN + (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) + IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END + END ParIntLiteral; + PROCEDURE ActualPar(n: OPT.Node; fp: OPT.Object); VAR typ, aptyp: OPT.Struct; comp, form, mode, prec, dim: INTEGER; BEGIN @@ -465,8 +476,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - ELSIF (form = OPT.LInt) & (n^.typ^.form < OPT.LInt) THEN (* integral promotion *) + (* + ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) OPM.WriteString("(LONGINT)"); prec := 9 + *) + ELSIF form IN OPT.intSet THEN + SizeCast(n.typ.size, typ.size) END END ELSIF ansi THEN @@ -475,9 +490,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form = OPT.LInt) & (n^.class = OPT.Nconst) - & (n^.conval^.intval <= OPM.SignedMaximum(OPM.IntSize)) & (n^.conval^.intval >= OPM.SignedMinimum(OPM.IntSize)) THEN - OPM.WriteString("((LONGINT)("); expr(n, prec); OPM.WriteString("))"); + ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) END; @@ -485,7 +499,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); OPM.WriteString("(LONGINT)"); OPM.WriteInt(n^.conval^.intval2) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -497,7 +511,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 WHILE aptyp^.comp = OPT.DynArr DO Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))"); + (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) + ParIntLiteral(aptyp.size, OPM.PointerSize) END END END ; @@ -551,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.conv: Convert(l, n.typ, exprPrec) | OPT.abs: IF SideEffects(l) THEN IF l^.typ^.form < OPT.Real THEN - IF l^.typ^.form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF l.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END ; OPM.WriteString("__ABSF(") ELSE OPM.WriteString("__ABSFD(") END @@ -560,7 +575,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -616,11 +631,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString("__ROT(") END | OPS.div: IF SideEffects(n) THEN - IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; OPM.WriteString("__DIVF(") ELSE OPM.WriteString("__DIV(") END - | OPS.mod: IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + | OPS.mod: IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; @@ -782,18 +797,20 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF base^.form = OPT.Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; - OPM.WriteString(", "); OPM.WriteString("((LONGINT)("); OPM.WriteInt(base^.size); OPM.WriteString("))"); + OPM.WriteString(", "); OPM.WriteInt(base.size); OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN - IF x^.class = OPT.Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") - ELSE OPM.WriteString("(LONGINT)"); expr(x, 10) + IF x^.class = OPT.Nconst THEN + OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link - ELSE OPM.WriteString("(LONGINT)"); OPM.WriteInt(typ^.n) + ELSE + OPC.IntLiteral(typ.n, OPM.PointerSize) END ; typ := typ^.BaseTyp END ;