Uppercase internal SYSTEM.H types address, int*, uint*. Phase 1.

This commit is contained in:
David Brown 2016-11-08 11:48:33 +00:00
parent 1935f63cd6
commit baeb2db81f
205 changed files with 8388 additions and 8311 deletions

View file

@ -27,7 +27,10 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers.
## Installation
###### Prerequisites
While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries
with the following simple steps.
###### 1. Install prerequisites
| Platform | Packages |
| --------- | ------------ |
@ -39,7 +42,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers.
More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md).
###### Build and install
###### 2. Build and install the compiler and libraries
1. `git clone https://github.com/vishaps/voc`
2. `cd voc`
@ -47,7 +50,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat
Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges.
###### PATH environment variable
###### 3. Stet your PATH environment variable
Set your path to the installed compiler binary location as reported
by make full, e.g.
@ -61,6 +64,7 @@ by make full, e.g.
Also see [**Installation**](/doc/Installation.md).
## A 'Hello' application
Anything appended to Oberon.Log is automatically written to stdout, so the

View file

@ -24,7 +24,7 @@
int64 SYSTEM_DIV(int64 x, int64 y)
INT64 SYSTEM_DIV(INT64 x, INT64 y)
{
if (x == 0) return 0;
if (x >= 0)
@ -35,7 +35,7 @@ int64 SYSTEM_DIV(int64 x, int64 y)
else {return (-x)/(-y);}
}
int64 SYSTEM_MOD(int64 x, int64 y)
INT64 SYSTEM_MOD(INT64 x, INT64 y)
{
if (x == 0) return 0;
if (x >= 0)
@ -46,31 +46,20 @@ int64 SYSTEM_MOD(int64 x, int64 y)
else {return -((-x) % (-y));}
}
// LONGINT SYSTEM_ENTIER(double x)
// {
// LONGINT y;
// if (x >= 0)
// return (LONGINT)x;
// else {
// y = (LONGINT)x;
// if (y <= x) return y; else return y - 1;
// }
// }
int64 SYSTEM_ENTIER(double x)
INT64 SYSTEM_ENTIER(double x)
{
int64 y;
INT64 y;
if (x >= 0)
return (int64)x;
return (INT64)x;
else {
y = (int64)x;
y = (INT64)x;
if (y <= x) return y; else return y - 1;
}
}
void SYSTEM_INHERIT(address *t, address *t0)
void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0)
{
t -= __TPROC0OFF;
t0 -= __TPROC0OFF;
@ -78,23 +67,23 @@ void SYSTEM_INHERIT(address *t, address *t0)
}
void SYSTEM_ENUMP(void *adr, address n, void (*P)())
void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)())
{
while (n > 0) {
P((address)(*((void**)(adr))));
P((ADDRESS)(*((void**)(adr))));
adr = ((void**)adr) + 1;
n--;
}
}
void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)())
void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)())
{
address *t, off;
ADDRESS *t, off;
typ++;
while (n > 0) {
t = typ;
off = *t;
while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;}
while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;}
adr = ((char*)adr) + size;
n--;
}
@ -103,19 +92,19 @@ void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)())
extern void Heap_Lock();
extern void Heap_Unlock();
SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...)
SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...)
{
address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off;
ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off;
va_list ap;
va_start(ap, nofdyn);
nofelems = 1;
while (nofdim > 0) {
nofelems = nofelems * va_arg(ap, address); nofdim--;
nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--;
if (nofelems <= 0) __HALT(-20);
}
va_end(ap);
dataoff = nofdyn * sizeof(address);
if (elemalgn > sizeof(address)) {
dataoff = nofdyn * sizeof(ADDRESS);
if (elemalgn > sizeof(ADDRESS)) {
n = dataoff % elemalgn;
if (n != 0) dataoff += elemalgn - n;
}
@ -125,37 +114,37 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim,
/* element typ does not contain pointers */
x = Heap_NEWBLK(size);
}
else if (typ == (address*)POINTER__typ) {
else if (typ == (ADDRESS*)POINTER__typ) {
/* element type is a pointer */
x = Heap_NEWBLK(size + nofelems * sizeof(address));
p = (address*)(address)x[-1];
x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS));
p = (ADDRESS*)(ADDRESS)x[-1];
p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */
while (n <= nofelems) {*p = n*sizeof(address); p++; n++;}
*p = - (nofelems + 1) * sizeof(address); /* sentinel */
x[-1] -= nofelems * sizeof(address);
while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;}
*p = - (nofelems + 1) * sizeof(ADDRESS); /* sentinel */
x[-1] -= nofelems * sizeof(ADDRESS);
}
else {
/* element type is a record that contains pointers */
ptab = typ + 1; nofptrs = 0;
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
nptr = nofelems * nofptrs; /* total number of pointers */
x = Heap_NEWBLK(size + nptr * sizeof(address));
p = (address*)(address)x[- 1];
x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS));
p = (ADDRESS*)(ADDRESS)x[- 1];
p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
p -= nptr - 1; n = 0; off = dataoff;
while (n < nofelems) {i = 0;
while (i < nofptrs) {*p = off + ptab[i]; p++; i++;}
off += elemsz; n++;
}
*p = - (nptr + 1) * sizeof(address); /* sentinel */
x[-1] -= nptr * sizeof(address);
*p = - (nptr + 1) * sizeof(ADDRESS); /* sentinel */
x[-1] -= nptr * sizeof(ADDRESS);
}
if (nofdyn != 0) {
/* setup len vector for index checks */
va_start(ap, nofdyn);
p = x;
while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;}
while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;}
va_end(ap);
}
Heap_Unlock();
@ -165,7 +154,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim,
typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler
typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler
#ifndef _WIN32
@ -177,7 +166,7 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler
// (Ignore other signals)
}
void SystemSetHandler(int s, address h) {
void SystemSetHandler(int s, ADDRESS h) {
if (s >= 2 && s <= 4) {
int needtosetsystemhandler = handler[s-2] == 0;
handler[s-2] = (SystemSignalHandler)h;
@ -216,12 +205,12 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler
}
}
void SystemSetInterruptHandler(address h) {
void SystemSetInterruptHandler(ADDRESS h) {
EnsureConsoleCtrlHandler();
SystemInterruptHandler = (SystemSignalHandler)h;
}
void SystemSetQuitHandler(address h) {
void SystemSetQuitHandler(ADDRESS h) {
EnsureConsoleCtrlHandler();
SystemQuitHandler = (SystemSignalHandler)h;
}

View file

@ -33,22 +33,22 @@ void *alloca(size_t size);
#if defined (o__64) && !defined(_WIN64)
// LP64
typedef long int64;
typedef unsigned long uint64;
typedef long INT64;
typedef unsigned long UINT64;
#else
// ILP32 or LLP64
typedef long long int64;
typedef unsigned long long uint64;
typedef long long INT64;
typedef unsigned long long UINT64;
#endif
typedef int int32;
typedef unsigned int uint32;
typedef int INT32;
typedef unsigned int UINT32;
typedef short int int16;
typedef unsigned short int uint16;
typedef short int INT16;
typedef unsigned short int UINT16;
typedef signed char int8;
typedef unsigned char uint8;
typedef signed char INT8;
typedef unsigned char UINT8;
// The compiler uses 'import' and 'export' which translate to 'extern' and
@ -63,29 +63,41 @@ typedef unsigned char uint8;
#define NIL ((void*)0)
#define __MAXEXT 16
#define POINTER__typ ((address*)(1)) // not NIL and not a valid type
#define POINTER__typ ((ADDRESS*)(1)) // not NIL and not a valid type
// Oberon types
typedef int8 BOOLEAN;
typedef int8 SYSTEM_BYTE;
typedef uint8 CHAR;
typedef INT8 BOOLEAN;
typedef INT8 SYSTEM_BYTE;
typedef UINT8 CHAR;
typedef float REAL;
typedef double LONGREAL;
typedef void* SYSTEM_PTR;
// 'address' is a synonym for an int of pointer size
// 'ADDRESS' is a synonym for an integer of pointer size
#if defined (o__64)
#define address int64
#define ADDRESS INT64
#else
#define address int32
#define ADDRESS INT32
#endif
// Temporary build support - which changing lowercase int* and address to uppercase
#define int8 INT8
#define int16 INT16
#define int32 INT32
#define int64 INT64
#define uint8 UINT8
#define uint16 UINT16
#define uint32 UINT32
#define uint64 UINT64
#define address ADDRESS
@ -96,30 +108,30 @@ typedef void* SYSTEM_PTR;
// OS Memory allocation interfaces are in PlatformXXX.Mod
extern address Platform_OSAllocate (address size);
extern void Platform_OSFree (address addr);
extern ADDRESS Platform_OSAllocate (ADDRESS size);
extern void Platform_OSFree (ADDRESS addr);
// Assertions and Halts
extern void Platform_Halt(int32 x);
extern void Platform_AssertFail(int32 x);
extern void Platform_Halt(INT32 x);
extern void Platform_AssertFail(INT32 x);
#define __HALT(x) Platform_Halt(x)
#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x))
#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x))
// Index checking
static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;}
static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;}
#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0))
// Range checking, and checked SHORT and CHR functions
static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;}
static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;}
#define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0))
#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0)))
#define __SHORT(x, ub) ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0)))
#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub)))
#define __CHR(x) ((CHAR)__R(x, 256))
#define __CHRF(x) ((CHAR)__RF(x, 256))
@ -129,10 +141,10 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return
// Signal handling in SYSTEM.c
#ifndef _WIN32
extern void SystemSetHandler(int s, address h);
extern void SystemSetHandler(int s, ADDRESS h);
#else
extern void SystemSetInterruptHandler(address h);
extern void SystemSetQuitHandler (address h);
extern void SystemSetInterruptHandler(ADDRESS h);
extern void SystemSetQuitHandler (ADDRESS h);
#endif
@ -140,7 +152,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return
// String comparison
static inline int __str_cmp(CHAR *x, CHAR *y){
int64 i = 0;
INT64 i = 0;
CHAR ch1, ch2;
do {ch1 = x[i]; ch2 = y[i]; i++;
if (!ch1) return -(int)ch2;
@ -164,8 +176,8 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
#define __VAL(t, x) (*(t*)&(x))
#define __GET(a, x, t) x=*(t*)(address)(a)
#define __PUT(a, x, t) *(t*)(address)(a)=x
#define __GET(a, x, t) x=*(t*)(ADDRESS)(a)
#define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x
#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n)))
#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n)))
@ -175,34 +187,34 @@ static inline int __str_cmp(CHAR *x, CHAR *y){
#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n))))
#define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s))
#define __ASHL(x, n) ((int64)(x)<<(n))
#define __ASHR(x, n) ((int64)(x)>>(n))
#define __ASHL(x, n) ((INT64)(x)<<(n))
#define __ASHR(x, n) ((INT64)(x)>>(n))
#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n)))
static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);}
#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n))
static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);}
#define __ASHF(x, n) SYSTEM_ASH((INT64)(x), (INT64)(n))
#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n)
#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n)
extern int64 SYSTEM_DIV(int64 x, int64 y);
extern INT64 SYSTEM_DIV(INT64 x, INT64 y);
#define __DIVF(x, y) SYSTEM_DIV(x, y)
#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y))
extern int64 SYSTEM_MOD(int64 x, int64 y);
extern INT64 SYSTEM_MOD(INT64 x, INT64 y);
#define __MODF(x, y) SYSTEM_MOD(x, y)
#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y))
extern int64 SYSTEM_ENTIER (double x);
extern INT64 SYSTEM_ENTIER (double x);
#define __ENTIER(x) SYSTEM_ENTIER(x)
#define __ABS(x) (((x)<0)?-(x):(x))
static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;}
static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;}
#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i))
static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;}
static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;}
#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x))
static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
#define __ABSFD(x) SYSTEM_ABSD(x)
@ -216,7 +228,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h)))
#define __MASK(x, m) ((x)&~(m))
#define __BIT(x, n) (*(uint64*)(x)>>(n)&1)
#define __BIT(x, n) (*(UINT64*)(x)>>(n)&1)
@ -227,8 +239,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;}
#define __WITHCHK __HALT(-7)
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ)
#define __TYPEOF(p) (*(((address**)(p))-1))
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ)
#define __TYPEOF(p) (*(((ADDRESS**)(p))-1))
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
@ -257,67 +269,67 @@ extern void Heap_INCREF();
// Main module initialisation, registration and finalisation
extern void Platform_Init(int32 argc, address argv);
extern void Platform_Init(INT32 argc, ADDRESS argv);
extern void Heap_FINALL();
#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv);
#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv);
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
#define __FINI Heap_FINALL(); return 0
// Memory allocation
extern SYSTEM_PTR Heap_NEWBLK (address size);
extern SYSTEM_PTR Heap_NEWREC (address tag);
extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...);
extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size);
extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag);
extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...);
#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len))
#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ)
#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len))
#define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ)
#define __NEWARR SYSTEM_NEWARR
/* Type handling */
extern void SYSTEM_INHERIT(address *t, address *t0);
extern void SYSTEM_ENUMP (void *adr, address n, void (*P)());
extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)());
extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0);
extern void SYSTEM_ENUMP (void *adr, ADDRESS n, void (*P)());
extern void SYSTEM_ENUMR (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)());
#define __TDESC(t, m, n) \
static struct t##__desc { \
address tproc[m]; /* Proc for each ptr field */ \
address tag; \
address next; /* Module table type list points here */ \
address level; \
address module; \
ADDRESS tproc[m]; /* Proc for each ptr field */ \
ADDRESS tag; \
ADDRESS next; /* Module table type list points here */ \
ADDRESS level; \
ADDRESS module; \
char name[24]; \
address basep[__MAXEXT]; /* List of bases this extends */ \
address reserved; \
address blksz; /* xxx_typ points here */ \
address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \
ADDRESS basep[__MAXEXT]; /* List of bases this extends */ \
ADDRESS reserved; \
ADDRESS blksz; /* xxx_typ points here */ \
ADDRESS ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \
} t##__desc
#define __BASEOFF (__MAXEXT+1) // blksz as index to base.
#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1.
#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5) // blksz as index to tproc IFF m=1.
#define __EOM 1
#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size
#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P)
#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P)
#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (ADDRESS)(n), P)
#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P)
#define __INITYP(t, t0, level) \
t##__typ = (address*)&t##__desc.blksz; \
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \
t##__desc.basep[level] = (address)t##__typ; \
t##__desc.module = (address)m; \
t##__typ = (ADDRESS*)&t##__desc.blksz; \
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS)); \
t##__desc.basep[level] = (ADDRESS)t##__typ; \
t##__desc.module = (ADDRESS)m; \
if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \
t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \
Heap_REGTYP(m, (address)&t##__desc.next); \
t##__desc.blksz = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \
Heap_REGTYP(m, (ADDRESS)&t##__desc.next); \
SYSTEM_INHERIT(t##__typ, t0##__typ)
// Oberon-2 type bound procedures support
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -26,7 +26,7 @@ static CHAR Compiler_mname[256];
export void Compiler_Module (BOOLEAN *done);
static void Compiler_PropagateElementaryTypeSizes (void);
export void Compiler_Translate (void);
static void Compiler_Trap (int32 sig);
static void Compiler_Trap (INT32 sig);
void Compiler_Module (BOOLEAN *done)
@ -147,7 +147,7 @@ void Compiler_Translate (void)
}
}
static void Compiler_Trap (int32 sig)
static void Compiler_Trap (INT32 sig)
{
Heap_FINALL();
if (sig == 3) {

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -18,7 +18,7 @@ typedef
struct Files_BufDesc {
Files_File f;
BOOLEAN chg;
int32 org, size;
INT32 org, size;
SYSTEM_BYTE data[4096];
} Files_BufDesc;
@ -33,85 +33,85 @@ typedef
Files_FileName workName, registerName;
BOOLEAN tempFile;
Platform_FileIdentity identity;
int32 fd, len, pos;
INT32 fd, len, pos;
Files_Buffer bufs[4];
int16 swapper, state;
INT16 swapper, state;
Files_File next;
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
Files_Buffer buf;
int32 org, offset;
INT32 org, offset;
} Files_Rider;
static Files_File Files_files;
static int16 Files_tempno;
static INT16 Files_tempno;
static CHAR Files_HOME[1024];
static struct {
LONGINT len[1];
CHAR data[1];
} *Files_SearchPath;
export address *Files_FileDesc__typ;
export address *Files_BufDesc__typ;
export address *Files_Rider__typ;
export ADDRESS *Files_FileDesc__typ;
export ADDRESS *Files_BufDesc__typ;
export ADDRESS *Files_Rider__typ;
export Files_File Files_Base (Files_Rider *r, address *r__typ);
export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
export void Files_Close (Files_File f);
static void Files_CloseOSFile (Files_File f);
static void Files_Create (Files_File f);
export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode);
export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode);
static void Files_Finalize (SYSTEM_PTR o);
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len);
static void Files_Flush (Files_Buffer buf);
export void Files_GetDate (Files_File f, int32 *t, int32 *d);
export void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
export int32 Files_Length (Files_File f);
export INT32 Files_Length (Files_File f);
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
export Files_File Files_New (CHAR *name, LONGINT name__len);
export Files_File Files_Old (CHAR *name, LONGINT name__len);
export int32 Files_Pos (Files_Rider *r, address *r__typ);
export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
export void Files_Purge (Files_File f);
export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_Register (Files_File f);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
export void Files_SetSearchPath (CHAR *path, LONGINT path__len);
export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
#define Files_IdxTrap() __HALT(-1)
#define Files_ToAdr(x) (address)x
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode)
{
__DUP(s, s__len, CHAR);
Out_Ln();
@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len)
{
int16 i, j;
INT16 i, j;
__DUP(dir, dir__len, CHAR);
__DUP(name, name__len, CHAR);
i = 0;
@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len)
{
int32 n, i, j;
INT32 n, i, j;
__DUP(finalName, finalName__len, CHAR);
Files_tempno += 1;
n = Files_tempno;
@ -217,7 +217,7 @@ static void Files_Create (Files_File f)
{
Platform_FileIdentity identity;
BOOLEAN done;
int16 error;
INT16 error;
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
@ -254,7 +254,7 @@ static void Files_Create (Files_File f)
static void Files_Flush (Files_Buffer buf)
{
int16 error;
INT16 error;
Files_File f = NIL;
if (buf->chg) {
f = buf->f;
@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf)
static void Files_CloseOSFile (Files_File f)
{
Files_File prev = NIL;
int16 error;
INT16 error;
if (Files_files == f) {
Files_files = f->next;
} else {
@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f)
void Files_Close (Files_File f)
{
int32 i;
int16 error;
INT32 i;
INT16 error;
if (f->state != 1 || f->registerName[0] != 0x00) {
Files_Create(f);
i = 0;
@ -315,7 +315,7 @@ void Files_Close (Files_File f)
}
}
int32 Files_Length (Files_File f)
INT32 Files_Length (Files_File f)
{
return f->len;
}
@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
return f;
}
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
if (Files_SearchPath == NIL) {
@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
ch = name[0];
@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{
Files_File f = NIL;
int16 i, error;
INT16 i, error;
f = Files_files;
while (f != NIL) {
if (Platform_SameFile(identity, f->identity)) {
@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
Files_File Files_Old (CHAR *name, LONGINT name__len)
{
Files_File f = NIL;
int32 fd;
int16 pos;
INT32 fd;
INT16 pos;
BOOLEAN done;
CHAR dir[256], path[256];
int16 error;
INT16 error;
Platform_FileIdentity identity;
__DUP(name, name__len, CHAR);
if (name[0] != 0x00) {
@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
void Files_Purge (Files_File f)
{
int16 i;
INT16 i;
Platform_FileIdentity identity;
int16 error;
INT16 error;
i = 0;
while (i < 4) {
if (f->bufs[i] != NIL) {
@ -519,25 +519,25 @@ void Files_Purge (Files_File f)
Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity);
}
void Files_GetDate (Files_File f, int32 *t, int32 *d)
void Files_GetDate (Files_File f, INT32 *t, INT32 *d)
{
Platform_FileIdentity identity;
int16 error;
INT16 error;
Files_Create(f);
error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ);
Platform_MTimeAsClock(identity, &*t, &*d);
}
int32 Files_Pos (Files_Rider *r, address *r__typ)
INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).org + (*r).offset;
}
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos)
{
int32 org, offset, i, n;
INT32 org, offset, i, n;
Files_Buffer buf = NIL;
int16 error;
INT16 error;
if (f != NIL) {
if (pos > f->len) {
pos = f->len;
@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
(*r).res = 0;
}
void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
{
int32 offset;
INT32 offset;
Files_Buffer buf = NIL;
buf = (*r).buf;
offset = (*r).offset;
@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
}
}
void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
(*r).eof = 0;
}
Files_File Files_Base (Files_Rider *r, address *r__typ)
Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).buf->f;
}
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x)
{
Files_Buffer buf = NIL;
int32 offset;
INT32 offset;
buf = (*r).buf;
offset = (*r).offset;
if ((*r).org != buf->org || offset >= 4096) {
@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
(*r).res = 0;
}
void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
(*r).res = 0;
}
void Files_Delete (CHAR *name, LONGINT name__len, int16 *res)
void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res)
{
__DUP(name, name__len, CHAR);
*res = Platform_Unlink((void*)name, name__len);
__DEL(name);
}
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res)
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res)
{
int32 fdold, fdnew, n;
int16 error, ignore;
INT32 fdold, fdnew, n;
INT16 error, ignore;
Platform_FileIdentity oldidentity, newidentity;
CHAR buf[4096];
__DUP(old, old__len, CHAR);
@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
void Files_Register (Files_File f)
{
int16 idx, errcode;
INT16 idx, errcode;
Files_File f1 = NIL;
CHAR file[104];
if ((f->state == 1 && f->registerName[0] != 0x00)) {
@ -807,7 +807,7 @@ void Files_Register (Files_File f)
}
}
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res)
{
__DUP(path, path__len, CHAR);
*res = Platform_Chdir((void*)path, path__len);
@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len)
{
int32 i, j;
INT32 i, j;
if (!Platform_LittleEndian) {
i = src__len;
j = 0;
@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
}
}
void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x)
void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x)
{
Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
}
void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x)
void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = (int16)b[0] + __ASHL((int16)b[1], 8);
*x = (INT16)b[0] + __ASHL((INT16)b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x)
{
CHAR b[4];
int32 l;
INT32 l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (uint32)l;
l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (UINT32)l;
}
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x)
void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!(ch == 0x00));
}
void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
BOOLEAN b;
i = 0;
@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!b);
}
void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
int8 s, b;
int64 q;
INT8 s, b;
INT64 q;
s = 0;
q = 0;
Files_Read(&*R, R__typ, (void*)&b);
while (b < 0) {
q += (int64)__ASH(((int16)b + 128), s);
q += (INT64)__ASH(((INT16)b + 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&b);
}
q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
__ASSERT(x__len <= 8, 0);
__MOVE((address)&q, (address)x, x__len);
}
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x)
{
Files_Write(&*R, R__typ, __VAL(CHAR, x));
}
void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x)
{
CHAR b[2];
b[0] = (CHAR)x;
@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x)
{
CHAR b[4];
b[0] = (CHAR)x;
@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x)
{
CHAR b[4];
int32 i;
i = (int32)x;
INT32 i;
i = (INT32)x;
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x)
void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x)
void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
i = 0;
while (x[i] != 0x00) {
i += 1;
@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x)
{
while (x < -64 || x > 63) {
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len)
static void Files_Finalize (SYSTEM_PTR o)
{
Files_File f = NIL;
int32 res;
INT32 res;
f = (Files_File)(address)o;
if (f->fd >= 0) {
Files_CloseOSFile(f);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef Files__h
#define Files__h
@ -11,58 +11,58 @@ typedef
typedef
struct Files_FileDesc {
char _prvt0[216];
int32 fd;
INT32 fd;
char _prvt1[32];
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
char _prvt0[15];
} Files_Rider;
import address *Files_FileDesc__typ;
import address *Files_Rider__typ;
import ADDRESS *Files_FileDesc__typ;
import ADDRESS *Files_Rider__typ;
import Files_File Files_Base (Files_Rider *r, address *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
import void Files_Close (Files_File f);
import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
import void Files_GetDate (Files_File f, int32 *t, int32 *d);
import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
import void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
import int32 Files_Length (Files_File f);
import INT32 Files_Length (Files_File f);
import Files_File Files_New (CHAR *name, LONGINT name__len);
import Files_File Files_Old (CHAR *name, LONGINT name__len);
import int32 Files_Pos (Files_Rider *r, address *r__typ);
import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
import void Files_Purge (Files_File f);
import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_Register (Files_File f);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
import void Files_SetSearchPath (CHAR *path, LONGINT path__len);
import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void *Files__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -40,7 +40,7 @@ typedef
typedef
struct Heap_FinDesc {
Heap_FinNode next;
int32 obj;
INT32 obj;
BOOLEAN marked;
Heap_Finalizer finalize;
} Heap_FinDesc;
@ -55,53 +55,53 @@ typedef
struct Heap_ModuleDesc {
Heap_Module next;
Heap_ModuleName name;
int32 refcnt;
INT32 refcnt;
Heap_Cmd cmds;
int32 types;
INT32 types;
Heap_EnumProc enumPtrs;
int32 reserved1, reserved2;
INT32 reserved1, reserved2;
} Heap_ModuleDesc;
export SYSTEM_PTR Heap_modules;
static int32 Heap_freeList[10];
static int32 Heap_bigBlocks;
export int32 Heap_allocated;
static INT32 Heap_freeList[10];
static INT32 Heap_bigBlocks;
export INT32 Heap_allocated;
static BOOLEAN Heap_firstTry;
static int32 Heap_heap, Heap_heapend;
export int32 Heap_heapsize;
static INT32 Heap_heap, Heap_heapend;
export INT32 Heap_heapsize;
static Heap_FinNode Heap_fin;
static int16 Heap_lockdepth;
static INT16 Heap_lockdepth;
static BOOLEAN Heap_interrupted;
export int16 Heap_FileCount;
export INT16 Heap_FileCount;
export address *Heap_ModuleDesc__typ;
export address *Heap_CmdDesc__typ;
export address *Heap_FinDesc__typ;
export address *Heap__1__typ;
export ADDRESS *Heap_ModuleDesc__typ;
export ADDRESS *Heap_CmdDesc__typ;
export ADDRESS *Heap_FinDesc__typ;
export ADDRESS *Heap__1__typ;
static void Heap_CheckFin (void);
static void Heap_ExtendHeap (int32 blksz);
static void Heap_ExtendHeap (INT32 blksz);
export void Heap_FINALL (void);
static void Heap_Finalize (void);
export void Heap_GC (BOOLEAN markStack);
static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len);
static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len);
export void Heap_INCREF (Heap_Module m);
export void Heap_InitHeap (void);
export void Heap_Lock (void);
static void Heap_Mark (int32 q);
static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len);
static void Heap_Mark (INT32 q);
static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len);
static void Heap_MarkP (SYSTEM_PTR p);
static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (int32 size);
export SYSTEM_PTR Heap_NEWREC (int32 tag);
static int32 Heap_NewChunk (int32 blksz);
static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (INT32 size);
export SYSTEM_PTR Heap_NEWREC (INT32 tag);
static INT32 Heap_NewChunk (INT32 blksz);
export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
export void Heap_REGTYP (Heap_Module m, int32 typ);
export void Heap_REGTYP (Heap_Module m, INT32 typ);
export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
static void Heap_Scan (void);
static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len);
static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len);
export void Heap_Unlock (void);
extern void *Heap__init();
@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
m->cmds = c;
}
void Heap_REGTYP (Heap_Module m, int32 typ)
void Heap_REGTYP (Heap_Module m, INT32 typ)
{
__PUT(typ, m->types, int32);
__PUT(typ, m->types, INT32);
m->types = typ;
}
@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m)
m->refcnt += 1;
}
static int32 Heap_NewChunk (int32 blksz)
static INT32 Heap_NewChunk (INT32 blksz)
{
int32 chnk;
INT32 chnk;
chnk = Heap_OSAllocate(blksz + 12);
if (chnk != 0) {
__PUT(chnk + 4, chnk + (12 + blksz), int32);
__PUT(chnk + 12, chnk + 16, int32);
__PUT(chnk + 16, blksz, int32);
__PUT(chnk + 20, -4, int32);
__PUT(chnk + 24, Heap_bigBlocks, int32);
__PUT(chnk + 4, chnk + (12 + blksz), INT32);
__PUT(chnk + 12, chnk + 16, INT32);
__PUT(chnk + 16, blksz, INT32);
__PUT(chnk + 20, -4, INT32);
__PUT(chnk + 24, Heap_bigBlocks, INT32);
Heap_bigBlocks = chnk + 12;
Heap_heapsize += blksz;
}
return chnk;
}
static void Heap_ExtendHeap (int32 blksz)
static void Heap_ExtendHeap (INT32 blksz)
{
int32 size, chnk, j, next;
INT32 size, chnk, j, next;
if (blksz > 160000) {
size = blksz;
} else {
@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz)
chnk = Heap_NewChunk(size);
if (chnk != 0) {
if (chnk < Heap_heap) {
__PUT(chnk, Heap_heap, int32);
__PUT(chnk, Heap_heap, INT32);
Heap_heap = chnk;
} else {
j = Heap_heap;
__GET(j, next, int32);
__GET(j, next, INT32);
while ((next != 0 && chnk > next)) {
j = next;
__GET(j, next, int32);
__GET(j, next, INT32);
}
__PUT(chnk, next, int32);
__PUT(j, chnk, int32);
__PUT(chnk, next, INT32);
__PUT(j, chnk, INT32);
}
if (next == 0) {
__GET(chnk + 4, Heap_heapend, int32);
__GET(chnk + 4, Heap_heapend, INT32);
}
}
}
SYSTEM_PTR Heap_NEWREC (int32 tag)
SYSTEM_PTR Heap_NEWREC (INT32 tag)
{
int32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new;
Heap_Lock();
__GET(tag, blksz, int32);
__GET(tag, blksz, INT32);
i0 = __ASHR(blksz, 4);
i = i0;
if (i < 9) {
@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
}
}
if (i < 9) {
__GET(adr + 12, next, int32);
__GET(adr + 12, next, INT32);
Heap_freeList[i] = next;
if (i != i0) {
di = i - i0;
restsize = __ASHL(di, 4);
end = adr + restsize;
__PUT(end + 4, blksz, int32);
__PUT(end + 8, -4, int32);
__PUT(end, end + 4, int32);
__PUT(adr + 4, restsize, int32);
__PUT(adr + 12, Heap_freeList[di], int32);
__PUT(end + 4, blksz, INT32);
__PUT(end + 8, -4, INT32);
__PUT(end, end + 4, INT32);
__PUT(adr + 4, restsize, INT32);
__PUT(adr + 12, Heap_freeList[di], INT32);
Heap_freeList[di] = adr;
adr += restsize;
}
@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
return NIL;
}
}
__GET(adr + 4, t, int32);
__GET(adr + 4, t, INT32);
if (t >= blksz) {
break;
}
prev = adr;
__GET(adr + 12, adr, int32);
__GET(adr + 12, adr, INT32);
}
restsize = t - blksz;
end = adr + restsize;
__PUT(end + 4, blksz, int32);
__PUT(end + 8, -4, int32);
__PUT(end, end + 4, int32);
__PUT(end + 4, blksz, INT32);
__PUT(end + 8, -4, INT32);
__PUT(end, end + 4, INT32);
if (restsize > 144) {
__PUT(adr + 4, restsize, int32);
__PUT(adr + 4, restsize, INT32);
} else {
__GET(adr + 12, next, int32);
__GET(adr + 12, next, INT32);
if (prev == 0) {
Heap_bigBlocks = next;
} else {
__PUT(prev + 12, next, int32);
__PUT(prev + 12, next, INT32);
}
if (restsize > 0) {
di = __ASHR(restsize, 4);
__PUT(adr + 4, restsize, int32);
__PUT(adr + 12, Heap_freeList[di], int32);
__PUT(adr + 4, restsize, INT32);
__PUT(adr + 12, Heap_freeList[di], INT32);
Heap_freeList[di] = adr;
}
}
@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
i = adr + 16;
end = adr + blksz;
while (i < end) {
__PUT(i, 0, int32);
__PUT(i + 4, 0, int32);
__PUT(i + 8, 0, int32);
__PUT(i + 12, 0, int32);
__PUT(i, 0, INT32);
__PUT(i + 4, 0, INT32);
__PUT(i + 8, 0, INT32);
__PUT(i + 12, 0, INT32);
i += 16;
}
__PUT(adr + 12, 0, int32);
__PUT(adr, tag, int32);
__PUT(adr + 4, 0, int32);
__PUT(adr + 8, 0, int32);
__PUT(adr + 12, 0, INT32);
__PUT(adr, tag, INT32);
__PUT(adr + 4, 0, INT32);
__PUT(adr + 8, 0, INT32);
Heap_allocated += blksz;
Heap_Unlock();
return (SYSTEM_PTR)(address)(adr + 4);
}
SYSTEM_PTR Heap_NEWBLK (int32 size)
SYSTEM_PTR Heap_NEWBLK (INT32 size)
{
int32 blksz, tag;
INT32 blksz, tag;
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 31, 4), 4);
new = Heap_NEWREC((address)&blksz);
tag = ((int32)(address)new + blksz) - 12;
__PUT(tag - 4, 0, int32);
__PUT(tag, blksz, int32);
__PUT(tag + 4, -4, int32);
__PUT((int32)(address)new - 4, tag, int32);
tag = ((INT32)(address)new + blksz) - 12;
__PUT(tag - 4, 0, INT32);
__PUT(tag, blksz, INT32);
__PUT(tag + 4, -4, INT32);
__PUT((INT32)(address)new - 4, tag, INT32);
Heap_Unlock();
return new;
}
static void Heap_Mark (int32 q)
static void Heap_Mark (INT32 q)
{
int32 p, tag, offset, fld, n, tagbits;
INT32 p, tag, offset, fld, n, tagbits;
if (q != 0) {
__GET(q - 4, tagbits, int32);
__GET(q - 4, tagbits, INT32);
if (!__ODD(tagbits)) {
__PUT(q - 4, tagbits + 1, int32);
__PUT(q - 4, tagbits + 1, INT32);
p = 0;
tag = tagbits + 4;
for (;;) {
__GET(tag, offset, int32);
__GET(tag, offset, INT32);
if (offset < 0) {
__PUT(q - 4, (tag + offset) + 1, int32);
__PUT(q - 4, (tag + offset) + 1, INT32);
if (p == 0) {
break;
}
n = q;
q = p;
__GET(q - 4, tag, int32);
__GET(q - 4, tag, INT32);
tag -= 1;
__GET(tag, offset, int32);
__GET(tag, offset, INT32);
fld = q + offset;
__GET(fld, p, int32);
__GET(fld, p, INT32);
__PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR);
} else {
fld = q + offset;
__GET(fld, n, int32);
__GET(fld, n, INT32);
if (n != 0) {
__GET(n - 4, tagbits, int32);
__GET(n - 4, tagbits, INT32);
if (!__ODD(tagbits)) {
__PUT(n - 4, tagbits + 1, int32);
__PUT(q - 4, tag + 1, int32);
__PUT(n - 4, tagbits + 1, INT32);
__PUT(q - 4, tag + 1, INT32);
__PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR);
p = q;
q = n;
@ -379,12 +379,12 @@ static void Heap_Mark (int32 q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((int32)(address)p);
Heap_Mark((INT32)(address)p);
}
static void Heap_Scan (void)
{
int32 chnk, adr, end, start, tag, i, size, freesize;
INT32 chnk, adr, end, start, tag, i, size, freesize;
Heap_bigBlocks = 0;
i = 1;
while (i < 9) {
@ -396,58 +396,58 @@ static void Heap_Scan (void)
chnk = Heap_heap;
while (chnk != 0) {
adr = chnk + 12;
__GET(chnk + 4, end, int32);
__GET(chnk + 4, end, INT32);
while (adr < end) {
__GET(adr, tag, int32);
__GET(adr, tag, INT32);
if (__ODD(tag)) {
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 4, int32);
__PUT(start + 4, freesize, int32);
__PUT(start + 8, -4, int32);
__PUT(start, start + 4, INT32);
__PUT(start + 4, freesize, INT32);
__PUT(start + 8, -4, INT32);
i = __ASHR(freesize, 4);
freesize = 0;
if (i < 9) {
__PUT(start + 12, Heap_freeList[i], int32);
__PUT(start + 12, Heap_freeList[i], INT32);
Heap_freeList[i] = start;
} else {
__PUT(start + 12, Heap_bigBlocks, int32);
__PUT(start + 12, Heap_bigBlocks, INT32);
Heap_bigBlocks = start;
}
}
tag -= 1;
__PUT(adr, tag, int32);
__GET(tag, size, int32);
__PUT(adr, tag, INT32);
__GET(tag, size, INT32);
Heap_allocated += size;
adr += size;
} else {
__GET(tag, size, int32);
__GET(tag, size, INT32);
freesize += size;
adr += size;
}
}
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 4, int32);
__PUT(start + 4, freesize, int32);
__PUT(start + 8, -4, int32);
__PUT(start, start + 4, INT32);
__PUT(start + 4, freesize, INT32);
__PUT(start + 8, -4, INT32);
i = __ASHR(freesize, 4);
freesize = 0;
if (i < 9) {
__PUT(start + 12, Heap_freeList[i], int32);
__PUT(start + 12, Heap_freeList[i], INT32);
Heap_freeList[i] = start;
} else {
__PUT(start + 12, Heap_bigBlocks, int32);
__PUT(start + 12, Heap_bigBlocks, INT32);
Heap_bigBlocks = start;
}
}
__GET(chnk, chnk, int32);
__GET(chnk, chnk, INT32);
}
}
static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len)
static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len)
{
int32 i, j, x;
INT32 i, j, x;
j = l;
x = a[j];
for (;;) {
@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len)
a[i] = x;
}
static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len)
static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len)
{
int32 l, r, x;
INT32 l, r, x;
l = __ASHR(n, 1);
r = n - 1;
while (l > 0) {
@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len)
}
}
static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len)
static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len)
{
int32 chnk, adr, tag, next, lim, lim1, i, ptr, size;
INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size;
chnk = Heap_heap;
i = 0;
lim = cand[n - 1];
while ((chnk != 0 && chnk < lim)) {
adr = chnk + 12;
__GET(chnk + 4, lim1, int32);
__GET(chnk + 4, lim1, INT32);
if (lim < lim1) {
lim1 = lim;
}
while (adr < lim1) {
__GET(adr, tag, int32);
__GET(adr, tag, INT32);
if (__ODD(tag)) {
__GET(tag - 1, size, int32);
__GET(tag - 1, size, INT32);
adr += size;
} else {
__GET(tag, size, int32);
__GET(tag, size, INT32);
ptr = adr + 4;
while (cand[i] < ptr) {
i += 1;
@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len)
adr = next;
}
}
__GET(chnk, chnk, int32);
__GET(chnk, chnk, INT32);
}
}
static void Heap_CheckFin (void)
{
Heap_FinNode n;
int32 tag;
INT32 tag;
n = Heap_fin;
while (n != NIL) {
__GET(n->obj - 4, tag, int32);
__GET(n->obj - 4, tag, INT32);
if (!__ODD(tag)) {
n->marked = 0;
Heap_Mark(n->obj);
@ -571,10 +571,10 @@ void Heap_FINALL (void)
}
}
static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len)
{
SYSTEM_PTR frame;
int32 inc, nofcand, sp, p, stack0;
INT32 inc, nofcand, sp, p, stack0;
struct Heap__1 align;
if (n > 0) {
Heap_MarkStack(n - 1, cand, cand__len);
@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
inc = -inc;
}
while (sp != stack0) {
__GET(sp, p, int32);
__GET(sp, p, INT32);
if ((p > Heap_heap && p < Heap_heapend)) {
if (nofcand == cand__len) {
Heap_HeapSort(nofcand, (void*)cand, cand__len);
@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
void Heap_GC (BOOLEAN markStack)
{
Heap_Module m;
int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
int32 cand[10000];
INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
INT32 cand[10000];
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
Heap_Lock();
m = (Heap_Module)(address)Heap_modules;
@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (int32)(address)obj;
f->obj = (INT32)(address)obj;
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;
@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
void Heap_InitHeap (void)
{
Heap_heap = Heap_NewChunk(128000);
__GET(Heap_heap + 4, Heap_heapend, int32);
__PUT(Heap_heap, 0, int32);
__GET(Heap_heap + 4, Heap_heapend, INT32);
__PUT(Heap_heap, 0, INT32);
Heap_allocated = 0;
Heap_firstTry = 1;
Heap_freeList[9] = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#ifndef Heap__h
#define Heap__h
@ -22,7 +22,7 @@ typedef
typedef
struct Heap_ModuleDesc {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[44];
} Heap_ModuleDesc;
@ -31,21 +31,21 @@ typedef
import SYSTEM_PTR Heap_modules;
import int32 Heap_allocated, Heap_heapsize;
import int16 Heap_FileCount;
import INT32 Heap_allocated, Heap_heapsize;
import INT16 Heap_FileCount;
import address *Heap_ModuleDesc__typ;
import ADDRESS *Heap_ModuleDesc__typ;
import void Heap_FINALL (void);
import void Heap_GC (BOOLEAN markStack);
import void Heap_INCREF (Heap_Module m);
import void Heap_InitHeap (void);
import void Heap_Lock (void);
import SYSTEM_PTR Heap_NEWBLK (int32 size);
import SYSTEM_PTR Heap_NEWREC (int32 tag);
import SYSTEM_PTR Heap_NEWBLK (INT32 size);
import SYSTEM_PTR Heap_NEWREC (INT32 tag);
import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
import void Heap_REGTYP (Heap_Module m, int32 typ);
import void Heap_REGTYP (Heap_Module m, INT32 typ);
import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
import void Heap_Unlock (void);
import void *Heap__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -31,20 +31,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
int32 reserved1, reserved2;
INT32 types;
void (*enumPtrs)(void(*)(INT32));
INT32 reserved1, reserved2;
} Modules_ModuleDesc;
export int16 Modules_res;
export INT16 Modules_res;
export CHAR Modules_resMsg[256];
export Modules_ModuleName Modules_imported, Modules_importing;
export address *Modules_ModuleDesc__typ;
export address *Modules_CmdDesc__typ;
export ADDRESS *Modules_ModuleDesc__typ;
export ADDRESS *Modules_CmdDesc__typ;
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len);
export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
{
int16 i, j;
INT16 i, j;
__DUP(b, b__len, CHAR);
i = 0;
while (a[__X(i, a__len)] != 0x00) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Modules__h
#define Modules__h
@ -28,20 +28,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
INT32 types;
void (*enumPtrs)(void(*)(INT32));
char _prvt0[8];
} Modules_ModuleDesc;
import int16 Modules_res;
import INT16 Modules_res;
import CHAR Modules_resMsg[256];
import Modules_ModuleName Modules_imported, Modules_importing;
import address *Modules_ModuleDesc__typ;
import address *Modules_CmdDesc__typ;
import ADDRESS *Modules_ModuleDesc__typ;
import ADDRESS *Modules_CmdDesc__typ;
import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -11,13 +11,13 @@
#include "OPT.h"
static int16 OPB_exp;
static int64 OPB_maxExp;
static INT16 OPB_exp;
static INT64 OPB_maxExp;
export void OPB_Assign (OPT_Node *x, OPT_Node y);
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static int16 OPB_BoolToInt (BOOLEAN b);
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static INT16 OPB_BoolToInt (BOOLEAN b);
export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
static void OPB_CharToString (OPT_Node n);
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode);
@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo);
export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
static void OPB_CheckProc (OPT_Struct x, OPT_Object y);
static void OPB_CheckPtr (OPT_Node x, OPT_Node y);
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x);
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x);
static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp);
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
static void OPB_Convert (OPT_Node *x, OPT_Struct typ);
export void OPB_DeRef (OPT_Node *x);
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar);
@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y);
export void OPB_In (OPT_Node *x, OPT_Node y);
export void OPB_Index (OPT_Node *x, OPT_Node y);
export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
static BOOLEAN OPB_IntToBool (int64 i);
static BOOLEAN OPB_IntToBool (INT64 i);
export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
export void OPB_MOp (int8 op, OPT_Node *x);
export void OPB_MOp (INT8 op, OPT_Node *x);
export OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
export OPT_Node OPB_NewIntConst (int64 intval);
export OPT_Node OPB_NewIntConst (INT64 intval);
export OPT_Node OPB_NewLeaf (OPT_Object obj);
export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
export OPT_Node OPB_NewString (OPS_String str, int64 len);
export OPT_Node OPB_NewString (OPS_String str, INT64 len);
export OPT_Node OPB_Nil (void);
static BOOLEAN OPB_NotVar (OPT_Node x);
export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
export void OPB_OptIf (OPT_Node *x);
export void OPB_Param (OPT_Node ap, OPT_Object fp);
export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x);
static void OPB_SetIntType (OPT_Node node);
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
static void OPB_SetSetType (OPT_Node node);
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
export void OPB_StaticLink (int8 dlev);
export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
export void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
export void OPB_StaticLink (INT8 dlev);
export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
static void OPB_err (int16 n);
static int64 OPB_log (int64 x);
static void OPB_err (INT16 n);
static INT64 OPB_log (INT64 x);
static void OPB_err (int16 n)
static void OPB_err (INT16 n)
{
OPM_err(n);
}
@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
return node;
}
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
*last = y;
}
static int16 OPB_BoolToInt (BOOLEAN b)
static INT16 OPB_BoolToInt (BOOLEAN b)
{
if (b) {
return 1;
@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b)
__RETCHK;
}
static BOOLEAN OPB_IntToBool (int64 i)
static BOOLEAN OPB_IntToBool (INT64 i)
{
return i != 0;
}
@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node)
static void OPB_SetSetType (OPT_Node node)
{
int32 i32;
__GET((address)&node->conval->setval + 4, i32, int32);
INT32 i32;
__GET((address)&node->conval->setval + 4, i32, INT32);
if (i32 == 0) {
node->typ = OPT_set32typ;
} else {
@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node)
}
}
OPT_Node OPB_NewIntConst (int64 intval)
OPT_Node OPB_NewIntConst (INT64 intval)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
return x;
}
OPT_Node OPB_NewString (OPS_String str, int64 len)
OPT_Node OPB_NewString (OPS_String str, INT64 len)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n)
n->obj = NIL;
}
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x)
void OPB_Index (OPT_Node *x, OPT_Node y)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
f = y->typ->form;
if ((*x)->class >= 7) {
@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
}
if ((*x)->typ->comp == 2) {
typ = (*x)->typ->BaseTyp;
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) {
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) {
OPB_err(81);
}
} else if ((*x)->typ->comp == 3) {
@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
void OPB_In (OPT_Node *x, OPT_Node y)
{
int16 f;
int64 k;
INT16 f;
INT64 k;
f = (*x)->typ->form;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if ((f == 4 && y->typ->form == 7)) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) {
if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64));
@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
(*x)->typ = OPT_booltyp;
}
static int64 OPB_log (int64 x)
static INT64 OPB_log (INT64 x)
{
OPB_exp = 0;
if (x > 0) {
@ -478,7 +478,7 @@ static int64 OPB_log (int64 x)
return x;
}
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x)
{
LONGREAL min, max, r;
if (f == 5) {
@ -502,9 +502,9 @@ static struct MOp__28 {
struct MOp__28 *lnk;
} *MOp__28_s;
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z)
{
OPT_Node node = NIL;
node = OPT_NewNode(11);
@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
return node;
}
void OPB_MOp (int8 op, OPT_Node *x)
void OPB_MOp (INT8 op, OPT_Node *x)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node z = NIL;
struct MOp__28 _s;
@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int16)__CAP((CHAR)z->conval->intval);
z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
static void OPB_CheckPtr (OPT_Node x, OPT_Node y)
{
int16 g;
INT16 g;
OPT_Struct p = NIL, q = NIL, t = NIL;
g = y->typ->form;
if (g == 11) {
@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y)
static struct ConstOp__13 {
OPT_Node *x;
int16 *f;
INT16 *f;
OPT_Const *xval, *yval;
struct ConstOp__13 *lnk;
} *ConstOp__13_s;
static int16 ConstCmp__14 (void);
static INT16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void)
static INT16 ConstCmp__14 (void)
{
int16 res;
INT16 res;
switch (*ConstOp__13_s->f) {
case 0:
res = 9;
@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void)
return res;
}
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Const xval = NIL, yval = NIL;
int64 xv, yv;
INT64 xv, yv;
BOOLEAN temp;
struct ConstOp__13 _s;
_s.x = &x;
@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
{
OPT_Node node = NIL;
int16 f, g;
int64 k;
INT16 f, g;
INT64 k;
LONGREAL r;
f = (*x)->typ->form;
g = typ->form;
@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
OPB_err(203);
r = (LONGREAL)1;
}
(*x)->conval->intval = (int32)__ENTIER(r);
(*x)->conval->intval = (INT32)__ENTIER(r);
OPB_SetIntType(*x);
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
}
static struct Op__38 {
int16 *f, *g;
INT16 *f, *g;
struct Op__38 *lnk;
} *Op__38_s;
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y);
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(12);
@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
return ok;
}
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Node t = NIL, z = NIL;
OPT_Struct typ = NIL;
BOOLEAN do_;
int64 val;
INT64 val;
struct Op__38 _s;
_s.f = &f;
_s.g = &g;
@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_SetRange (OPT_Node *x, OPT_Node y)
{
int64 k, l;
INT64 k, l;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
void OPB_SetElem (OPT_Node *x)
{
int64 k;
INT64 k;
if ((*x)->class == 8 || (*x)->class == 9) {
OPB_err(126);
} else if ((*x)->typ->form != 4) {
@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{
OPT_Struct y = NIL;
int16 f, g;
INT16 f, g;
OPT_Struct p = NIL, q = NIL;
y = ynode->typ;
f = x->form;
@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo)
{
}
void OPB_StPar0 (OPT_Node *par0, int16 fctno)
void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node x = NIL;
x = *par0;
@ -1983,9 +1983,9 @@ static struct StPar1__53 {
struct StPar1__53 *lnk;
} *StPar1__53_s;
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
return node;
}
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
{
int16 f, L;
INT16 f, L;
OPT_Struct typ = NIL;
OPT_Node p = NIL, t = NIL;
struct StPar1__53 _s;
@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (f == 4) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) {
OPB_err(202);
}
p = NewOp__54(19, fctno, p, x);
@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(208);
p->conval->intval = 1;
} else if (x->conval->intval >= 0) {
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval);
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval);
} else {
OPB_err(208);
p->conval->intval = 1;
@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
StPar1__53_s = _s.lnk;
}
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
{
OPT_Node node = NIL;
int16 f;
INT16 f;
OPT_Node p = NIL;
p = *par0;
f = x->typ->form;
@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
*par0 = p;
}
void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
{
int16 dim;
INT16 dim;
OPT_Node x = NIL, p = NIL;
p = *par0;
if (fctno <= 19) {
@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar)
{
int16 f;
INT16 f;
f = atyp->comp;
ftyp = ftyp->BaseTyp;
atyp = atyp->BaseTyp;
@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
}
}
void OPB_StaticLink (int8 dlev)
void OPB_StaticLink (INT8 dlev)
{
OPT_Object scope = NIL;
scope = OPT_topScope;
@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp)
{
OPT_Struct typ = NIL;
OPT_Node p = NIL;
int8 lev;
INT8 lev;
if ((*x)->class == 9) {
typ = (*x)->typ;
lev = (*x)->obj->mnolev;
@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc)
void OPB_Assign (OPT_Node *x, OPT_Node y)
{
OPT_Node z = NIL;
int8 subcl;
INT8 subcl;
if ((*x)->class >= 7) {
OPB_err(56);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPB__h
#define OPB__h
@ -13,7 +13,7 @@
import void OPB_Assign (OPT_Node *x, OPT_Node y);
import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
import void OPB_DeRef (OPT_Node *x);
import OPT_Node OPB_EmptySet (void);
import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc);
@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y);
import void OPB_Index (OPT_Node *x, OPT_Node y);
import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
import void OPB_MOp (int8 op, OPT_Node *x);
import void OPB_MOp (INT8 op, OPT_Node *x);
import OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
import OPT_Node OPB_NewIntConst (int64 intval);
import OPT_Node OPB_NewIntConst (INT64 intval);
import OPT_Node OPB_NewLeaf (OPT_Object obj);
import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
import OPT_Node OPB_NewString (OPS_String str, int64 len);
import OPT_Node OPB_NewString (OPS_String str, INT64 len);
import OPT_Node OPB_Nil (void);
import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
import void OPB_OptIf (OPT_Node *x);
import void OPB_Param (OPT_Node ap, OPT_Object fp);
import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
import void OPB_Return (OPT_Node *x, OPT_Object proc);
import void OPB_SetElem (OPT_Node *x);
import void OPB_SetRange (OPT_Node *x, OPT_Node y);
import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
import void OPB_StPar0 (OPT_Node *par0, int16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
import void OPB_StaticLink (int8 dlev);
import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
import void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
import void OPB_StaticLink (INT8 dlev);
import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
import void *OPB__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -11,9 +11,9 @@
#include "OPT.h"
static int16 OPC_indentLevel;
static int8 OPC_hashtab[105];
static CHAR OPC_keytab[50][9];
static INT16 OPC_indentLevel;
static INT8 OPC_hashtab[105];
static CHAR OPC_keytab[60][9];
static BOOLEAN OPC_GlbPtrs;
static CHAR OPC_BodyNameExt[13];
@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames);
export OPT_Object OPC_BaseTProc (OPT_Object obj);
export void OPC_BegBlk (void);
export void OPC_BegStat (void);
static void OPC_CProcDefs (OPT_Object obj, int16 vis);
export void OPC_Case (int64 caseVal, int16 form);
static void OPC_CharacterLiteral (int64 c);
export void OPC_Cmp (int16 rel);
static void OPC_CProcDefs (OPT_Object obj, INT16 vis);
export void OPC_Case (INT64 caseVal, INT16 form);
static void OPC_CharacterLiteral (INT64 c);
export void OPC_Cmp (INT16 rel);
export void OPC_CompleteIdent (OPT_Object obj);
export void OPC_Constant (OPT_Const con, int16 form);
export void OPC_Constant (OPT_Const con, INT16 form);
static void OPC_DeclareBase (OPT_Object dcl);
static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef);
static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro);
@ -45,45 +45,45 @@ export void OPC_EnterBody (void);
export void OPC_EnterProc (OPT_Object proc);
export void OPC_ExitBody (void);
export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign);
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign);
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign);
export void OPC_GenBdy (OPT_Node n);
static void OPC_GenDynTypes (OPT_Node n, int16 vis);
static void OPC_GenDynTypes (OPT_Node n, INT16 vis);
export void OPC_GenEnumPtrs (OPT_Object var);
export void OPC_GenHdr (OPT_Node n);
export void OPC_GenHdrIncludes (void);
static void OPC_GenHeaderMsg (void);
export void OPC_Halt (int32 n);
export void OPC_Halt (INT32 n);
export void OPC_Ident (OPT_Object obj);
static void OPC_IdentList (OPT_Object obj, int16 vis);
static void OPC_IdentList (OPT_Object obj, INT16 vis);
static void OPC_Include (CHAR *name, LONGINT name__len);
static void OPC_IncludeImports (OPT_Object obj, int16 vis);
static void OPC_IncludeImports (OPT_Object obj, INT16 vis);
export void OPC_Increment (BOOLEAN decrement);
export void OPC_Indent (int16 count);
export void OPC_Indent (INT16 count);
export void OPC_Init (void);
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 (int64 n, int32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
export void OPC_IntLiteral (INT64 n, INT32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName);
static int16 OPC_Length (CHAR *s, LONGINT s__len);
static INT16 OPC_Length (CHAR *s, LONGINT s__len);
export BOOLEAN OPC_NeedsRetval (OPT_Object proc);
export int32 OPC_NofPtrs (OPT_Struct typ);
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
export INT32 OPC_NofPtrs (OPT_Struct typ);
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len);
static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define);
static void OPC_ProcPredefs (OPT_Object obj, int8 vis);
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis);
static void OPC_PutBase (OPT_Struct typ);
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt);
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt);
static void OPC_RegCmds (OPT_Object obj);
export void OPC_SetInclude (BOOLEAN exclude);
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause);
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l);
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l);
export void OPC_TDescDecl (OPT_Struct typ);
export void OPC_TypeDefs (OPT_Object obj, int16 vis);
export void OPC_TypeDefs (OPT_Object obj, INT16 vis);
export void OPC_TypeOf (OPT_Object ap);
static BOOLEAN OPC_Undefined (OPT_Object obj);
@ -94,14 +94,14 @@ void OPC_Init (void)
__MOVE("__init(void)", OPC_BodyNameExt, 13);
}
void OPC_Indent (int16 count)
void OPC_Indent (INT16 count)
{
OPC_indentLevel += count;
}
void OPC_BegStat (void)
{
int16 i;
INT16 i;
i = OPC_indentLevel;
while (i > 0) {
OPM_Write(0x09);
@ -137,10 +137,10 @@ void OPC_EndBlk0 (void)
OPM_Write('}');
}
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x)
{
CHAR ch;
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
ch = s[0];
i = 0;
@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
__DEL(s);
}
static int16 OPC_Length (CHAR *s, LONGINT s__len)
static INT16 OPC_Length (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len)
return i;
}
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{
int16 i, h;
INT16 i, h;
i = 0;
h = 0;
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
h = 3 * h + (int16)s[__X(i, s__len)];
h = 3 * h + (INT16)s[__X(i, s__len)];
i += 1;
}
return (int)__MOD(h, 105);
@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
void OPC_Ident (OPT_Object obj)
{
int16 mode, level, h;
INT16 mode, level, h;
mode = obj->mode;
level = obj->mnolev;
if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) {
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)], 50)], obj->name) == 0) {
if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) {
OPM_Write('_');
}
}
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
if (obj->typ == OPT_adrtyp) {
OPM_WriteString((CHAR*)"address", 8);
OPM_WriteString((CHAR*)"ADDRESS", 8);
} else {
if (obj->typ->form == 4) {
OPM_WriteString((CHAR*)"int", 4);
OPM_WriteString((CHAR*)"INT", 4);
} else {
OPM_WriteString((CHAR*)"uint", 5);
OPM_WriteString((CHAR*)"UINT", 5);
}
OPM_WriteInt(__ASHL(obj->typ->size, 3));
}
@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj)
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause)
{
int16 pointers;
INT16 pointers;
*openClause = 0;
if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) {
if (__IN(typ->comp, 0x0c, 32)) {
@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
{
OPT_Struct typ = NIL;
BOOLEAN varPar, openClause;
int16 form, comp;
INT16 form, comp;
typ = dcl->typ;
varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef;
OPC_Stars(typ, &openClause);
@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl)
{
OPT_Struct typ = NIL, prev = NIL;
OPT_Object obj = NIL;
int16 nofdims;
int32 off, n, dummy;
INT16 nofdims;
INT32 off, n, dummy;
typ = dcl->typ;
prev = typ;
while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) {
@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
}
}
int32 OPC_NofPtrs (OPT_Struct typ)
INT32 OPC_NofPtrs (OPT_Struct typ)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n;
INT32 n;
if ((typ->form == 11 && typ->sysflag == 0)) {
return 1;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ)
__RETCHK;
}
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt)
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n, i;
INT32 n, i;
if ((typ->form == 11 && typ->sysflag == 0)) {
OPM_WriteInt(adr);
OPM_WriteString((CHAR*)", ", 3);
@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ)
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName)
{
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (showParamName) {
OPC_Ident(par);
OPM_WriteString((CHAR*)"__len", 6);
@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj)
{
OPT_Struct typ = NIL, base = NIL;
int32 mno;
INT32 mno;
typ = obj->link->typ;
if (typ->form == 11) {
typ = typ->BaseTyp;
@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{
int16 i;
INT16 i;
__DUP(y, y__len, CHAR);
i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
return y[__X(i, y__len)] == 0x00;
}
static void OPC_CProcDefs (OPT_Object obj, int16 vis)
static void OPC_CProcDefs (OPT_Object obj, INT16 vis)
{
int16 i;
INT16 i;
OPT_ConstExt ext = NIL;
int16 _for__7;
INT16 _for__7;
if (obj != NIL) {
OPC_CProcDefs(obj->left, vis);
if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) {
if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) {
ext = obj->conval->ext;
i = 1;
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
OPC_DeclareParams(obj->link, 1);
OPM_Write(0x09);
}
_for__7 = (int16)(*obj->conval->ext)[0];
_for__7 = (INT16)(*obj->conval->ext)[0];
i = i;
while (i <= _for__7) {
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
}
}
void OPC_TypeDefs (OPT_Object obj, int16 vis)
void OPC_TypeDefs (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_TypeDefs(obj->left, vis);
@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n)
void OPC_TDescDecl (OPT_Struct typ)
{
int32 nofptrs;
INT32 nofptrs;
OPT_Object o = NIL;
OPC_BegStat();
OPM_WriteString((CHAR*)"__TDESC(", 9);
@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ)
}
}
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign)
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign)
{
int32 adr;
INT32 adr;
adr = off;
OPT_Align(&adr, align);
if ((*curAlign < align && gap - (adr - off) >= align)) {
@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
OPC_BegStat();
switch (align) {
case 2:
OPM_WriteString((CHAR*)"int16", 6);
OPM_WriteString((CHAR*)"INT16", 6);
break;
case 4:
OPM_WriteString((CHAR*)"int32", 6);
OPM_WriteString((CHAR*)"INT32", 6);
break;
case 8:
OPM_WriteString((CHAR*)"int64", 6);
OPM_WriteString((CHAR*)"INT64", 6);
break;
default:
OPM_LogWLn();
@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
}
}
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign)
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign)
{
OPT_Object fld = NIL;
OPT_Struct base = NIL;
int32 gap, adr, align, fldAlign;
INT32 gap, adr, align, fldAlign;
fld = typ->link;
align = __MASK(typ->align, -65536);
if (typ->BaseTyp != NIL) {
@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i
}
}
static void OPC_IdentList (OPT_Object obj, int16 vis)
static void OPC_IdentList (OPT_Object obj, INT16 vis)
{
OPT_Struct base = NIL;
BOOLEAN first;
int16 lastvis;
INT16 lastvis;
base = NIL;
first = 1;
while ((obj != NIL && obj->mode != 13)) {
if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
if (obj->typ != base || (int16)obj->vis != lastvis) {
if (obj->typ != base || (INT16)obj->vis != lastvis) {
if (!first) {
OPC_EndStat();
}
@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis)
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPC_EndStat();
OPC_BegStat();
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
base = NIL;
@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames)
OPM_WriteString((CHAR*)", LONGINT ", 11);
OPC_LenList(obj, 1, showParamNames);
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPM_WriteString((CHAR*)", address *", 12);
OPM_WriteString((CHAR*)", ADDRESS *", 12);
if (showParamNames) {
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
OPM_WriteLn();
}
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis)
{
if (obj != NIL) {
OPC_ProcPredefs(obj->left, vis);
@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len)
__DEL(name);
}
static void OPC_IncludeImports (OPT_Object obj, int16 vis)
static void OPC_IncludeImports (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_IncludeImports(obj->left, vis);
if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
}
OPC_IncludeImports(obj->right, vis);
}
}
static void OPC_GenDynTypes (OPT_Node n, int16 vis)
static void OPC_GenDynTypes (OPT_Node n, INT16 vis)
{
OPT_Struct typ = NIL;
while ((n != NIL && n->class == 14)) {
@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis)
} else {
OPM_WriteString((CHAR*)"export ", 8);
}
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Andent(typ);
OPM_WriteString((CHAR*)"__typ", 6);
OPC_EndStat();
@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void)
{
int16 i;
INT16 i;
OPM_WriteString((CHAR*)"/* ", 4);
OPM_WriteString((CHAR*)"voc", 4);
OPM_Write(' ');
@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n)
OPM_currFile = 1;
OPC_GenHeaderMsg();
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
OPM_WriteString((CHAR*)"#define SHORTINT INT", 21);
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
OPM_WriteString((CHAR*)"#define INTEGER INT", 21);
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
OPM_WriteString((CHAR*)"#define LONGINT INT", 21);
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SET uint", 22);
OPM_WriteString((CHAR*)"#define SET UINT", 22);
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
OPM_WriteLn();
OPM_WriteLn();
@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj)
void OPC_GenEnumPtrs (OPT_Object var)
{
OPT_Struct typ = NIL;
int32 n;
INT32 n;
OPC_GlbPtrs = 0;
while (var != NIL) {
typ = var->typ;
@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc)
{
OPT_Object var = NIL, scope = NIL;
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (proc->vis != 1) {
OPM_WriteString((CHAR*)"static ", 8);
}
@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet)
void OPC_CompleteIdent (OPT_Object obj)
{
int16 comp, level;
INT16 comp, level;
level = obj->mnolev;
if (obj->adr == 1) {
if (obj->typ->comp == 4) {
@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj)
void OPC_TypeOf (OPT_Object ap)
{
int16 i;
INT16 i;
__ASSERT(ap->typ->comp == 4, 0);
if (ap->mode == 2) {
if ((int16)ap->mnolev != OPM_level) {
if ((INT16)ap->mnolev != OPM_level) {
OPM_WriteStringVar((void*)ap->scope->name, 256);
OPM_WriteString((CHAR*)"_s->", 5);
OPC_Ident(ap);
@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap)
}
}
void OPC_Cmp (int16 rel)
void OPC_Cmp (INT16 rel)
{
switch (rel) {
case 9:
@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel)
}
}
static void OPC_CharacterLiteral (int64 c)
static void OPC_CharacterLiteral (INT64 c)
{
if (c < 32 || c > 126) {
OPM_WriteString((CHAR*)"0x", 3);
@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c)
}
}
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l)
{
int32 i;
int16 c;
INT32 i;
INT16 c;
__DUP(s, s__len, CHAR);
OPM_Write('"');
i = 0;
while (i < l) {
c = (int16)s[__X(i, s__len)];
c = (INT16)s[__X(i, s__len)];
if (c < 32 || c > 126) {
OPM_Write('\\');
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
__DEL(s);
}
void OPC_Case (int64 caseVal, int16 form)
void OPC_Case (INT64 caseVal, INT16 form)
{
CHAR ch;
OPM_WriteString((CHAR*)"case ", 6);
@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement)
}
}
void OPC_Halt (int32 n)
void OPC_Halt (INT32 n)
{
OPC_Str1((CHAR*)"__HALT(#)", 10, n);
}
void OPC_IntLiteral (int64 n, int32 size)
void OPC_IntLiteral (INT64 n, INT32 size)
{
if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) {
OPM_WriteString((CHAR*)"((int", 6);
OPM_WriteString((CHAR*)"((INT", 6);
OPM_WriteInt(__ASHL(size, 3));
OPM_WriteString((CHAR*)")(", 3);
OPM_WriteInt(n);
@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size)
}
}
void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim)
{
if (array->comp == 3) {
OPC_CompleteIdent(obj);
@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
}
}
void OPC_Constant (OPT_Const con, int16 form)
void OPC_Constant (OPT_Const con, INT16 form)
{
int16 i;
uint64 s;
int64 hex;
INT16 i;
UINT64 s;
INT64 hex;
BOOLEAN skipLeading;
switch (form) {
case 1:
@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form)
}
static struct InitKeywords__46 {
int8 *n;
INT8 *n;
struct InitKeywords__46 *lnk;
} *InitKeywords__46_s;
@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len);
static void Enter__47 (CHAR *s, LONGINT s__len)
{
int16 h;
INT16 h;
__DUP(s, s__len, CHAR);
h = OPC_PerfectHash((void*)s, s__len);
OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n;
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9);
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9);
*InitKeywords__46_s->n += 1;
__DEL(s);
}
static void OPC_InitKeywords (void)
{
int8 n, i;
INT8 n, i;
struct InitKeywords__46 _s;
_s.n = &n;
_s.lnk = InitKeywords__46_s;
@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void)
OPC_hashtab[__X(i, 105)] = -1;
i += 1;
}
Enter__47((CHAR*)"ADDRESS", 8);
Enter__47((CHAR*)"INT16", 6);
Enter__47((CHAR*)"INT32", 6);
Enter__47((CHAR*)"INT64", 6);
Enter__47((CHAR*)"INT8", 5);
Enter__47((CHAR*)"UINT16", 7);
Enter__47((CHAR*)"UINT32", 7);
Enter__47((CHAR*)"UINT64", 7);
Enter__47((CHAR*)"UINT8", 6);
Enter__47((CHAR*)"address", 8);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"asm", 4);
Enter__47((CHAR*)"auto", 5);
Enter__47((CHAR*)"break", 6);
@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"if", 3);
Enter__47((CHAR*)"import", 7);
Enter__47((CHAR*)"int", 4);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"long", 5);
Enter__47((CHAR*)"register", 9);
Enter__47((CHAR*)"return", 7);
@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"struct", 7);
Enter__47((CHAR*)"switch", 7);
Enter__47((CHAR*)"typedef", 8);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"union", 6);
Enter__47((CHAR*)"unsigned", 9);
Enter__47((CHAR*)"void", 5);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPC__h
#define OPC__h
@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ);
import OPT_Object OPC_BaseTProc (OPT_Object obj);
import void OPC_BegBlk (void);
import void OPC_BegStat (void);
import void OPC_Case (int64 caseVal, int16 form);
import void OPC_Cmp (int16 rel);
import void OPC_Case (INT64 caseVal, INT16 form);
import void OPC_Cmp (INT16 rel);
import void OPC_CompleteIdent (OPT_Object obj);
import void OPC_Constant (OPT_Const con, int16 form);
import void OPC_Constant (OPT_Const con, INT16 form);
import void OPC_DefineInter (OPT_Object proc);
import void OPC_EndBlk (void);
import void OPC_EndBlk0 (void);
@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n);
import void OPC_GenEnumPtrs (OPT_Object var);
import void OPC_GenHdr (OPT_Node n);
import void OPC_GenHdrIncludes (void);
import void OPC_Halt (int32 n);
import void OPC_Halt (INT32 n);
import void OPC_Ident (OPT_Object obj);
import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (int16 count);
import void OPC_Indent (INT16 count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (int64 n, int32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
import void OPC_IntLiteral (INT64 n, INT32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
import BOOLEAN OPC_NeedsRetval (OPT_Object proc);
import int32 OPC_NofPtrs (OPT_Struct typ);
import INT32 OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);
import void OPC_TDescDecl (OPT_Struct typ);
import void OPC_TypeDefs (OPT_Object obj, int16 vis);
import void OPC_TypeDefs (OPT_Object obj, INT16 vis);
import void OPC_TypeOf (OPT_Object ap);
import void *OPC__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -22,81 +22,81 @@ typedef
static CHAR OPM_SourceFileName[256];
static CHAR OPM_GlobalModel[10];
export CHAR OPM_Model[10];
static int16 OPM_GlobalAddressSize;
export int16 OPM_AddressSize;
static int16 OPM_GlobalAlignment;
export int16 OPM_Alignment;
export uint32 OPM_GlobalOptions, OPM_Options;
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export int64 OPM_MaxIndex;
static INT16 OPM_GlobalAddressSize;
export INT16 OPM_AddressSize;
static INT16 OPM_GlobalAlignment;
export INT16 OPM_Alignment;
export UINT32 OPM_GlobalOptions, OPM_Options;
export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export INT64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr;
export int32 OPM_curpos, OPM_errpos, OPM_breakpc;
export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Writer OPM_W;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
static int16 OPM_S;
static INT16 OPM_S;
export CHAR OPM_ResourceDir[1024];
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F);
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F);
export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void);
export void OPM_DeleteNewSym (void);
export void OPM_FPrint (int32 *fp, int64 val);
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
export void OPM_FPrintReal (int32 *fp, REAL real);
export void OPM_FPrintSet (int32 *fp, uint64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
export void OPM_FPrint (INT32 *fp, INT64 val);
export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
export void OPM_FPrintReal (INT32 *fp, REAL real);
export void OPM_FPrintSet (INT32 *fp, UINT64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
export void OPM_Get (CHAR *ch);
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
export void OPM_InitOptions (void);
export int16 OPM_Integer (int64 n);
static void OPM_LogErrMsg (int16 n);
export INT16 OPM_Integer (INT64 n);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogW (CHAR ch);
export void OPM_LogWLn (void);
export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWNum (INT64 i, INT64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n);
export INT32 OPM_Longint (INT64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int32 pos);
export void OPM_Mark (INT16 n, INT32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
export BOOLEAN OPM_OpenPar (void);
export void OPM_RegisterNewSym (void);
static void OPM_ScanOptions (CHAR *s, LONGINT s__len);
static void OPM_ShowLine (int64 pos);
export int64 OPM_SignedMaximum (int32 bytecount);
export int64 OPM_SignedMinimum (int32 bytecount);
static void OPM_ShowLine (INT64 pos);
export INT64 OPM_SignedMaximum (INT32 bytecount);
export INT64 OPM_SignedMinimum (INT32 bytecount);
export void OPM_SymRCh (CHAR *ch);
export int32 OPM_SymRInt (void);
export int64 OPM_SymRInt64 (void);
export INT32 OPM_SymRInt (void);
export INT64 OPM_SymRInt64 (void);
export void OPM_SymRLReal (LONGREAL *lr);
export void OPM_SymRReal (REAL *r);
export void OPM_SymRSet (uint64 *s);
export void OPM_SymRSet (UINT64 *s);
export void OPM_SymWCh (CHAR ch);
export void OPM_SymWInt (int64 i);
export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (uint64 s);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (int64 i);
export void OPM_WriteInt (int64 i);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
export void OPM_WriteLn (void);
export void OPM_WriteReal (LONGREAL r, CHAR suffx);
export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void);
export void OPM_err (int16 n);
export void OPM_err (INT16 n);
#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s
@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len)
__DEL(s);
}
void OPM_LogWNum (int64 i, int64 len)
void OPM_LogWNum (INT64 i, INT64 len)
{
Out_Int(i, len);
}
@ -122,32 +122,32 @@ void OPM_LogWLn (void)
Out_Ln();
}
int64 OPM_SignedMaximum (int32 bytecount)
INT64 OPM_SignedMaximum (INT32 bytecount)
{
int64 result;
INT64 result;
result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
return result - 1;
}
int64 OPM_SignedMinimum (int32 bytecount)
INT64 OPM_SignedMinimum (INT32 bytecount)
{
return -OPM_SignedMaximum(bytecount) - 1;
}
int32 OPM_Longint (int64 n)
INT32 OPM_Longint (INT64 n)
{
return __VAL(int32, n);
return __VAL(INT32, n);
}
int16 OPM_Integer (int64 n)
INT16 OPM_Integer (INT64 n)
{
return __VAL(int16, n);
return __VAL(INT16, n);
}
static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
i = 1;
while (s[__X(i, s__len)] != 0x00) {
@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
OPM_LogWLn();
} else {
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48;
i += 2;
}
break;
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
@ -465,7 +465,7 @@ void OPM_InitOptions (void)
void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
{
Texts_Text T = NIL;
int32 beg, end, time;
INT32 beg, end, time;
CHAR s[256];
*done = 0;
OPM_curpos = 0;
@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch)
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len)
{
int16 i, j;
INT16 i, j;
CHAR ch;
__DUP(ext, ext__len, CHAR);
i = 0;
@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
__DEL(ext);
}
static void OPM_LogErrMsg (int16 n)
static void OPM_LogErrMsg (INT16 n)
{
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
int16 i;
INT16 i;
CHAR buf[1024];
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n)
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos)
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
{
CHAR ch, cheol;
if (pos < (int64)OPM_ErrorLineStartPos) {
if (pos < (INT64)OPM_ErrorLineStartPos) {
OPM_ErrorLineStartPos = 0;
OPM_ErrorLineLimitPos = 0;
OPM_ErrorLineNumber = 0;
}
if (pos < (int64)OPM_ErrorLineLimitPos) {
if (pos < (INT64)OPM_ErrorLineLimitPos) {
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
return;
}
Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos);
Files_Read(&*r, r__typ, (void*)&ch);
while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos;
OPM_ErrorLineNumber += 1;
while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) {
@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
}
static void OPM_ShowLine (int64 pos)
static void OPM_ShowLine (INT64 pos)
{
Files_File f = NIL;
Files_Rider r;
CHAR line[1023];
int16 i;
INT16 i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos)
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= (int64)OPM_ErrorLineLimitPos) {
if (pos >= (INT64)OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos);
i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f);
}
void OPM_Mark (int16 n, int32 pos)
void OPM_Mark (INT16 n, INT32 pos)
{
if (pos == -1) {
pos = 0;
@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos)
}
}
void OPM_err (int16 n)
void OPM_err (INT16 n)
{
OPM_Mark(n, OPM_errpos);
}
void OPM_FPrint (int32 *fp, int64 val)
void OPM_FPrint (INT32 *fp, INT64 val)
{
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
*fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32);
}
void OPM_FPrintSet (int32 *fp, uint64 set)
void OPM_FPrintSet (INT32 *fp, UINT64 set)
{
OPM_FPrint(&*fp, __VAL(int32, set));
OPM_FPrint(&*fp, __VAL(INT32, set));
}
void OPM_FPrintReal (int32 *fp, REAL real)
void OPM_FPrintReal (INT32 *fp, REAL real)
{
int16 i;
int32 l;
__GET((address)&real, l, int32);
INT16 i;
INT32 l;
__GET((address)&real, l, INT32);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (int32 *fp, LONGREAL lr)
void OPM_FPrintLReal (INT32 *fp, LONGREAL lr)
{
int32 l, h;
__GET((address)&lr, l, int32);
__GET((address)&lr + 4, h, int32);
INT32 l, h;
__GET((address)&lr, l, INT32);
__GET((address)&lr + 4, h, INT32);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}
@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch)
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch);
}
int32 OPM_SymRInt (void)
INT32 OPM_SymRInt (void)
{
int32 k;
INT32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
return k;
}
int64 OPM_SymRInt64 (void)
INT64 OPM_SymRInt64 (void)
{
int64 k;
INT64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
return k;
}
void OPM_SymRSet (uint64 *s)
void OPM_SymRSet (UINT64 *s)
{
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8);
}
@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch)
Files_Write(&OPM_newSF, Files_Rider__typ, ch);
}
void OPM_SymWInt (int64 i)
void OPM_SymWInt (INT64 i)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
}
void OPM_SymWSet (uint64 s)
void OPM_SymWSet (UINT64 s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s);
}
void OPM_SymWReal (REAL r)
@ -841,7 +841,7 @@ void OPM_Write (CHAR ch)
void OPM_WriteString (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (int64 i)
void OPM_WriteHex (INT64 i)
{
CHAR s[3];
int32 digit;
digit = __ASHR((int32)i, 4);
INT32 digit;
digit = __ASHR((INT32)i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int32)i, -16);
digit = __MASK((INT32)i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i)
OPM_WriteString(s, 3);
}
void OPM_WriteInt (int64 i)
void OPM_WriteInt (INT64 i)
{
CHAR s[24];
int64 i1, k;
INT64 i1, k;
if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_Reader R;
CHAR s[32];
CHAR ch;
int16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
INT16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt((int32)__ENTIER(r));
OPM_WriteInt((INT32)__ENTIER(r));
} else {
Texts_OpenWriter(&W, Texts_Writer__typ);
if (suffx == 'f') {
@ -960,7 +960,7 @@ void OPM_WriteLn (void)
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F)
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F)
{
Files_Rider R1;
CHAR buffer[4096];
@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
void OPM_CloseFiles (void)
{
CHAR FName[32];
int16 res;
INT16 res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPM__h
#define OPM__h
@ -7,14 +7,14 @@
import CHAR OPM_Model[10];
import int16 OPM_AddressSize, OPM_Alignment;
import uint32 OPM_GlobalOptions, OPM_Options;
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import int64 OPM_MaxIndex;
import INT16 OPM_AddressSize, OPM_Alignment;
import UINT32 OPM_GlobalOptions, OPM_Options;
import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import INT64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr;
import int32 OPM_curpos, OPM_errpos, OPM_breakpc;
import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import CHAR OPM_modName[32];
import CHAR OPM_objname[64];
import CHAR OPM_ResourceDir[1024];
@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024];
import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void);
import void OPM_FPrint (int32 *fp, int64 val);
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
import void OPM_FPrintReal (int32 *fp, REAL real);
import void OPM_FPrintSet (int32 *fp, uint64 set);
import void OPM_FPrint (INT32 *fp, INT64 val);
import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
import void OPM_FPrintReal (INT32 *fp, REAL real);
import void OPM_FPrintSet (INT32 *fp, UINT64 set);
import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
import void OPM_InitOptions (void);
import int16 OPM_Integer (int64 n);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWNum (INT64 i, INT64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int32 pos);
import INT32 OPM_Longint (INT64 n);
import void OPM_Mark (INT16 n, INT32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
import BOOLEAN OPM_OpenPar (void);
import void OPM_RegisterNewSym (void);
import int64 OPM_SignedMaximum (int32 bytecount);
import int64 OPM_SignedMinimum (int32 bytecount);
import INT64 OPM_SignedMaximum (INT32 bytecount);
import INT64 OPM_SignedMinimum (INT32 bytecount);
import void OPM_SymRCh (CHAR *ch);
import int32 OPM_SymRInt (void);
import int64 OPM_SymRInt64 (void);
import INT32 OPM_SymRInt (void);
import INT64 OPM_SymRInt64 (void);
import void OPM_SymRLReal (LONGREAL *lr);
import void OPM_SymRReal (REAL *r);
import void OPM_SymRSet (uint64 *s);
import void OPM_SymRSet (UINT64 *s);
import void OPM_SymWCh (CHAR ch);
import void OPM_SymWInt (int64 i);
import void OPM_SymWInt (INT64 i);
import void OPM_SymWLReal (LONGREAL lr);
import void OPM_SymWReal (REAL r);
import void OPM_SymWSet (uint64 s);
import void OPM_SymWSet (UINT64 s);
import void OPM_Write (CHAR ch);
import void OPM_WriteHex (int64 i);
import void OPM_WriteInt (int64 i);
import void OPM_WriteHex (INT64 i);
import void OPM_WriteInt (INT64 i);
import void OPM_WriteLn (void);
import void OPM_WriteReal (LONGREAL r, CHAR suffx);
import void OPM_WriteString (CHAR *s, LONGINT s__len);
import void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
import BOOLEAN OPM_eofSF (void);
import void OPM_err (int16 n);
import void OPM_err (INT16 n);
import void *OPM__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPB.h"
@ -12,38 +12,38 @@
#include "OPT.h"
struct OPP__1 {
int32 low, high;
INT32 low, high;
};
typedef
struct OPP__1 OPP_CaseTable[128];
static int8 OPP_sym, OPP_level;
static int16 OPP_LoopLevel;
static INT8 OPP_sym, OPP_level;
static INT16 OPP_LoopLevel;
static OPT_Node OPP_TDinit, OPP_lastTDinit;
static int16 OPP_nofFwdPtr;
static INT16 OPP_nofFwdPtr;
static OPT_Struct OPP_FwdPtr[64];
export address *OPP__1__typ;
export ADDRESS *OPP__1__typ;
static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar);
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (int8 *vis);
static void OPP_CheckSym (int16 s);
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (INT8 *vis);
static void OPP_CheckSym (INT16 s);
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_);
static void OPP_ConstExpression (OPT_Node *x);
static void OPP_Element (OPT_Node *x);
static void OPP_Expression (OPT_Node *x);
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
static void OPP_Factor (OPT_Node *x);
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
export void OPP_Module (OPT_Node *prog, uint32 opt);
export void OPP_Module (OPT_Node *prog, UINT32 opt);
static void OPP_PointerType (OPT_Struct *typ);
static void OPP_ProcedureDeclaration (OPT_Node *x);
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Sets (OPT_Node *x);
static void OPP_SimpleExpression (OPT_Node *x);
@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat);
static void OPP_Term (OPT_Node *x);
static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_err (int16 n);
static void OPP_err (INT16 n);
static void OPP_qualident (OPT_Object *id);
static void OPP_selector (OPT_Node *x);
static void OPP_err (int16 n)
static void OPP_err (INT16 n)
{
OPM_err(n);
}
static void OPP_CheckSym (int16 s)
static void OPP_CheckSym (INT16 s)
{
if ((int16)OPP_sym == s) {
if ((INT16)OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s)
static void OPP_qualident (OPT_Object *id)
{
OPT_Object obj = NIL;
int8 lev;
INT8 lev;
OPT_Find(&obj);
OPS_Get(&OPP_sym);
if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) {
@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x)
}
}
static void OPP_CheckMark (int8 *vis)
static void OPP_CheckMark (INT8 *vis)
{
OPS_Get(&OPP_sym);
if (OPP_sym == 1 || OPP_sym == 7) {
@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis)
}
}
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_)
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_)
{
OPT_Node x = NIL;
int64 sf;
INT64 sf;
if (OPP_sym == 31) {
OPS_Get(&OPP_sym);
if (!OPT_SYSimported) {
@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL;
OPT_Struct ftyp = NIL;
int16 sysflag;
INT16 sysflag;
*typ = OPT_NewStr(13, 4);
(*typ)->BaseTyp = NIL;
OPP_CheckSysFlag(&sysflag, -1);
@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Node x = NIL;
int64 n;
int16 sysflag;
INT64 n;
INT16 sysflag;
OPP_CheckSysFlag(&sysflag, 0);
if (OPP_sym == 25) {
*typ = OPT_NewStr(13, 3);
@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ)
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp)
{
int8 mode;
INT8 mode;
OPT_Object par = NIL, first = NIL, last = NIL, res = NIL;
OPT_Struct typ = NIL;
first = NIL;
@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar)
static void OPP_StandProcCall (OPT_Node *x)
{
OPT_Node y = NIL;
int8 m;
int16 n;
m = (int8)((int16)(*x)->obj->adr);
INT8 m;
INT16 n;
m = (INT8)((INT16)(*x)->obj->adr);
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x)
static void OPP_Term (OPT_Node *x)
{
OPT_Node y = NIL;
int8 mulop;
INT8 mulop;
OPP_Factor(&*x);
while ((1 <= OPP_sym && OPP_sym <= 5)) {
mulop = OPP_sym;
@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x)
static void OPP_SimpleExpression (OPT_Node *x)
{
OPT_Node y = NIL;
int8 addop;
INT8 addop;
if (OPP_sym == 7) {
OPS_Get(&OPP_sym);
OPP_Term(&*x);
@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x)
{
OPT_Node y = NIL;
OPT_Object obj = NIL;
int8 relation;
INT8 relation;
OPP_SimpleExpression(&*x);
if ((9 <= OPP_sym && OPP_sym <= 14)) {
relation = OPP_sym;
@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x)
}
}
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
{
OPT_Object obj = NIL;
*typ = OPT_undftyp;
@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 {
OPT_Node *x;
OPT_Object *proc, *fwd;
OPS_Name *name;
int8 *mode, *vis;
INT8 *mode, *vis;
BOOLEAN *forward;
struct ProcedureDeclaration__16 *lnk;
} *ProcedureDeclaration__16_s;
@ -930,8 +930,8 @@ static void TProcDecl__23 (void);
static void GetCode__19 (void)
{
OPT_ConstExt ext = NIL;
int16 n;
int64 c;
INT16 n;
INT64 c;
ext = OPT_NewExt();
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
@ -995,7 +995,7 @@ static void GetParams__21 (void)
static void Body__17 (void)
{
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
c = OPM_errpos;
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64);
OPP_CheckSym(39);
@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void)
{
OPT_Object baseProc = NIL;
OPT_Struct objTyp = NIL, recTyp = NIL;
int8 objMode;
INT8 objMode;
OPS_Name objName;
OPS_Get(&OPP_sym);
*ProcedureDeclaration__16_s->mode = 13;
@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
{
OPT_Object proc = NIL, fwd = NIL;
OPS_Name name;
int8 mode, vis;
INT8 mode, vis;
BOOLEAN forward;
struct ProcedureDeclaration__16 _s;
_s.x = x;
@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
ProcedureDeclaration__16_s = _s.lnk;
}
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab)
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab)
{
OPT_Node x = NIL, y = NIL, lastlab = NIL;
int16 i, f;
int32 xval, yval;
INT16 i, f;
INT32 xval, yval;
*lab = NIL;
lastlab = NIL;
for (;;) {
@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int16)LabelTyp->form != f) {
} else if ((INT16)LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = OPM_Longint(y->conval->intval);
if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
OPP_err(60);
}
if (yval < xval) {
@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
}
static struct StatSeq__30 {
int32 *pos;
INT32 *pos;
struct StatSeq__30 *lnk;
} *StatSeq__30_s;
@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x);
static void CasePart__31 (OPT_Node *x)
{
int16 n;
int32 low, high;
INT16 n;
INT32 low, high;
BOOLEAN e;
OPP_CaseTable tab;
OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL;
@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPT_Struct idtyp = NIL;
BOOLEAN e;
OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL;
int32 pos;
INT32 pos;
OPS_Name name;
struct StatSeq__30 _s;
_s.pos = &pos;
@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPT_Struct typ = NIL;
OPT_Object obj = NIL, first = NIL, last = NIL;
OPT_Node x = NIL, lastdec = NIL;
int16 i;
INT16 i;
first = NIL;
last = NIL;
OPP_nofFwdPtr = 0;
@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_CheckSym(41);
}
void OPP_Module (OPT_Node *prog, uint32 opt)
void OPP_Module (OPT_Node *prog, UINT32 opt)
{
OPS_Name impName, aliasName;
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
BOOLEAN done;
OPS_Init();
OPP_LoopLevel = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPP__h
#define OPP__h
@ -9,7 +9,7 @@
import void OPP_Module (OPT_Node *prog, uint32 opt);
import void OPP_Module (OPT_Node *prog, UINT32 opt);
import void *OPP__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -17,29 +17,29 @@ typedef
export OPS_Name OPS_name;
export OPS_String OPS_str;
export int16 OPS_numtyp;
export int64 OPS_intval;
export INT16 OPS_numtyp;
export INT64 OPS_intval;
export REAL OPS_realval;
export LONGREAL OPS_lrlval;
static CHAR OPS_ch;
export void OPS_Get (int8 *sym);
static void OPS_Identifier (int8 *sym);
export void OPS_Get (INT8 *sym);
static void OPS_Identifier (INT8 *sym);
export void OPS_Init (void);
static void OPS_Number (void);
static void OPS_Str (int8 *sym);
static void OPS_err (int16 n);
static void OPS_Str (INT8 *sym);
static void OPS_err (INT16 n);
static void OPS_err (int16 n)
static void OPS_err (INT16 n)
{
OPM_err(n);
}
static void OPS_Str (int8 *sym)
static void OPS_Str (INT8 *sym)
{
int16 i;
INT16 i;
CHAR och;
i = 0;
och = OPS_ch;
@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int16)OPS_str[0];
OPS_intval = (INT16)OPS_str[0];
} else {
*sym = 37;
}
}
static void OPS_Identifier (int8 *sym)
static void OPS_Identifier (INT8 *sym)
{
int16 i;
INT16 i;
i = 0;
do {
OPS_name[i] = OPS_ch;
@ -92,10 +92,10 @@ static struct Number__6 {
struct Number__6 *lnk;
} *Number__6_s;
static int16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (int16 e);
static INT16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (INT16 e);
static LONGREAL Ten__9 (int16 e)
static LONGREAL Ten__9 (INT16 e)
{
LONGREAL x, p;
x = (LONGREAL)1;
@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e)
return x;
}
static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static INT16 Ord__7 (CHAR ch, BOOLEAN hex)
{
if (ch <= '9') {
return (int16)ch - 48;
return (INT16)ch - 48;
} else if (hex) {
return ((int16)ch - 65) + 10;
return ((INT16)ch - 65) + 10;
} else {
OPS_err(2);
return 0;
@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static void OPS_Number (void)
{
int16 i, m, n, d, e;
INT16 i, m, n, d, e;
CHAR dig[24];
LONGREAL f;
CHAR expCh;
@ -173,7 +173,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -187,7 +187,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -198,8 +198,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) {
OPS_intval = OPS_intval * 10 + (int64)d;
if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) {
OPS_intval = OPS_intval * 10 + (INT64)d;
} else {
OPS_err(203);
}
@ -308,9 +308,9 @@ static void Comment__2 (void)
}
}
void OPS_Get (int8 *sym)
void OPS_Get (INT8 *sym)
{
int8 s;
INT8 s;
struct Get__1 _s;
_s.lnk = Get__1_s;
Get__1_s = &_s;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef OPS__h
#define OPS__h
@ -14,13 +14,13 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import INT16 OPS_numtyp;
import INT64 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;
import void OPS_Get (int8 *sym);
import void OPS_Get (INT8 *sym);
import void OPS_Init (void);
import void *OPS__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -18,18 +18,18 @@ typedef
typedef
struct OPT_ConstDesc {
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint64 setval;
INT64 intval;
INT32 intval2;
UINT64 setval;
LONGREAL realval;
} OPT_ConstDesc;
typedef
struct OPT_ExpCtxt {
int32 reffp;
int16 ref;
int8 nofm;
int8 locmno[64];
INT32 reffp;
INT16 ref;
INT8 nofm;
INT8 locmno[64];
} OPT_ExpCtxt;
typedef
@ -40,13 +40,13 @@ typedef
typedef
struct OPT_ImpCtxt {
int32 nextTag, reffp;
int16 nofr, minr, nofm;
INT32 nextTag, reffp;
INT16 nofr, minr, nofm;
BOOLEAN self;
OPT_Struct ref[255];
OPT_Object old[255];
int32 pvfp[255];
int8 glbmno[64];
INT32 pvfp[255];
INT8 glbmno[64];
} OPT_ImpCtxt;
typedef
@ -55,7 +55,7 @@ typedef
typedef
struct OPT_NodeDesc {
OPT_Node left, right, link;
int8 class, subcl;
INT8 class, subcl;
BOOLEAN readonly;
OPT_Struct typ;
OPT_Object obj;
@ -67,22 +67,22 @@ typedef
OPT_Object left, right, link, scope;
OPS_Name name;
BOOLEAN leaf;
int8 mode, mnolev, vis, history;
INT8 mode, mnolev, vis, history;
BOOLEAN used, fpdone;
int32 fprint;
INT32 fprint;
OPT_Struct typ;
OPT_Const conval;
int32 adr, linkadr;
int16 x;
INT32 adr, linkadr;
INT16 x;
} OPT_ObjDesc;
typedef
struct OPT_StrDesc {
int8 form, comp, mno, extlev;
int16 ref, sysflag;
int32 n, size, align, txtpos;
INT8 form, comp, mno, extlev;
INT16 ref, sysflag;
INT32 n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused, fpdone, idfpdone;
int32 idfp, pbfp, pvfp;
INT32 idfp, pbfp, pvfp;
OPT_Struct BaseTyp;
OPT_Object link, strobj;
} OPT_StrDesc;
@ -91,80 +91,80 @@ typedef
export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
export int8 OPT_nofGmod;
export INT8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64];
export OPS_Name OPT_SelfName;
export BOOLEAN OPT_SYSimported;
static OPT_Object OPT_universe, OPT_syslink;
static OPT_ImpCtxt OPT_impCtxt;
static OPT_ExpCtxt OPT_expCtxt;
static int32 OPT_nofhdfld;
static INT32 OPT_nofhdfld;
static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew;
static int32 OPT_recno;
static INT32 OPT_recno;
export address *OPT_ConstDesc__typ;
export address *OPT_ObjDesc__typ;
export address *OPT_StrDesc__typ;
export address *OPT_NodeDesc__typ;
export address *OPT_ImpCtxt__typ;
export address *OPT_ExpCtxt__typ;
export ADDRESS *OPT_ConstDesc__typ;
export ADDRESS *OPT_ObjDesc__typ;
export ADDRESS *OPT_StrDesc__typ;
export ADDRESS *OPT_NodeDesc__typ;
export ADDRESS *OPT_ImpCtxt__typ;
export ADDRESS *OPT_ExpCtxt__typ;
export void OPT_Align (int32 *adr, int32 base);
export int32 OPT_BaseAlignment (OPT_Struct typ);
export void OPT_Align (INT32 *adr, INT32 base);
export INT32 OPT_BaseAlignment (OPT_Struct typ);
export void OPT_Close (void);
export void OPT_CloseScope (void);
static void OPT_DebugStruct (OPT_Struct btyp);
static void OPT_EnterBoolConst (OPS_Name name, int32 value);
static void OPT_EnterProc (OPS_Name name, int16 num);
static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res);
static void OPT_EnterBoolConst (OPS_Name name, INT32 value);
static void OPT_EnterProc (OPS_Name name, INT16 num);
static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res);
static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res);
export void OPT_Export (BOOLEAN *ext, BOOLEAN *new);
export void OPT_FPrintErr (OPT_Object obj, int16 errcode);
static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintErr (OPT_Object obj, INT16 errcode);
static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintObj (OPT_Object obj);
static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par);
static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par);
export void OPT_FPrintStr (OPT_Struct typ);
export void OPT_Find (OPT_Object *res);
export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
export void OPT_FindImport (OPT_Object mod, OPT_Object *res);
export void OPT_IdFPrint (OPT_Struct typ);
export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
static void OPT_InConstant (int32 f, OPT_Const conval);
static void OPT_InConstant (INT32 f, OPT_Const conval);
static OPT_Object OPT_InFld (void);
static void OPT_InMod (int8 *mno);
static void OPT_InMod (INT8 *mno);
static void OPT_InName (CHAR *name, LONGINT name__len);
static OPT_Object OPT_InObj (int8 mno);
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
static OPT_Object OPT_InObj (INT8 mno);
static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par);
static void OPT_InStruct (OPT_Struct *typ);
static OPT_Object OPT_InTProc (int8 mno);
static OPT_Struct OPT_InTyp (int32 tag);
export void OPT_Init (OPS_Name name, uint32 opt);
static OPT_Object OPT_InTProc (INT8 mno);
static OPT_Struct OPT_InTyp (INT32 tag);
export void OPT_Init (OPS_Name name, UINT32 opt);
export void OPT_InitRecno (void);
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
static void OPT_InitStruct (OPT_Struct *typ, INT8 form);
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
export int16 OPT_IntSize (int64 n);
export OPT_Struct OPT_IntType (int32 size);
export INT16 OPT_IntSize (INT64 n);
export OPT_Struct OPT_IntType (INT32 size);
export OPT_Const OPT_NewConst (void);
export OPT_ConstExt OPT_NewExt (void);
export OPT_Node OPT_NewNode (int8 class);
export OPT_Node OPT_NewNode (INT8 class);
export OPT_Object OPT_NewObj (void);
export OPT_Struct OPT_NewStr (int8 form, int8 comp);
export void OPT_OpenScope (int8 level, OPT_Object owner);
export OPT_Struct OPT_NewStr (INT8 form, INT8 comp);
export void OPT_OpenScope (INT8 level, OPT_Object owner);
static void OPT_OutConstant (OPT_Object obj);
static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr);
static void OPT_OutMod (int16 mno);
static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr);
static void OPT_OutMod (INT16 mno);
static void OPT_OutName (CHAR *name, LONGINT name__len);
static void OPT_OutObj (OPT_Object obj);
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
static void OPT_OutStr (OPT_Struct typ);
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
export OPT_Struct OPT_SetType (int32 size);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
export int32 OPT_SizeAlignment (int32 size);
export OPT_Struct OPT_SetType (INT32 size);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
export INT32 OPT_SizeAlignment (INT32 size);
export void OPT_TypSize (OPT_Struct typ);
static void OPT_err (int16 n);
static void OPT_err (INT16 n);
void OPT_InitRecno (void)
@ -172,14 +172,14 @@ void OPT_InitRecno (void)
OPT_recno = 0;
}
static void OPT_err (int16 n)
static void OPT_err (INT16 n)
{
OPM_err(n);
}
int16 OPT_IntSize (int64 n)
INT16 OPT_IntSize (INT64 n)
{
int16 bytes;
INT16 bytes;
if (n < 0) {
n = -(n + 1);
}
@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n)
return bytes;
}
OPT_Struct OPT_IntType (int32 size)
OPT_Struct OPT_IntType (INT32 size)
{
if (size <= OPT_int8typ->size) {
return OPT_int8typ;
@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size)
return OPT_int64typ;
}
OPT_Struct OPT_SetType (int32 size)
OPT_Struct OPT_SetType (INT32 size)
{
if (size == OPT_set32typ->size) {
return OPT_set32typ;
@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size)
return OPT_set64typ;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir)
{
int16 i;
INT16 i;
__ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0);
@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
__RETCHK;
}
void OPT_Align (int32 *adr, int32 base)
void OPT_Align (INT32 *adr, INT32 base)
{
switch (base) {
case 2:
@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base)
}
}
int32 OPT_SizeAlignment (int32 size)
INT32 OPT_SizeAlignment (INT32 size)
{
int32 alignment;
INT32 alignment;
if (size < OPM_Alignment) {
alignment = 1;
while (alignment < size) {
@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size)
return alignment;
}
int32 OPT_BaseAlignment (OPT_Struct typ)
INT32 OPT_BaseAlignment (OPT_Struct typ)
{
int32 alignment;
INT32 alignment;
if (typ->form == 13) {
if (typ->comp == 4) {
alignment = __MASK(typ->align, -65536);
@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
void OPT_TypSize (OPT_Struct typ)
{
int16 f, c;
int32 offset, size, base, fbase, off0;
INT16 f, c;
INT32 offset, size, base, fbase, off0;
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
if (typ == OPT_undftyp) {
@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ)
}
typ->size = offset;
typ->align = base;
typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8);
typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8);
} else if (c == 2) {
OPT_TypSize(typ->BaseTyp);
typ->size = typ->n * typ->BaseTyp->size;
@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void)
return obj;
}
OPT_Struct OPT_NewStr (int8 form, int8 comp)
OPT_Struct OPT_NewStr (INT8 form, INT8 comp)
{
OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc);
@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
return typ;
}
OPT_Node OPT_NewNode (int8 class)
OPT_Node OPT_NewNode (INT8 class)
{
OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc);
@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void)
return ext;
}
void OPT_OpenScope (int8 level, OPT_Object owner)
void OPT_OpenScope (INT8 level, OPT_Object owner)
{
OPT_Object head = NIL;
head = OPT_NewObj();
@ -429,7 +429,7 @@ void OPT_CloseScope (void)
OPT_topScope = OPT_topScope->left;
}
void OPT_Init (OPS_Name name, uint32 opt)
void OPT_Init (OPS_Name name, UINT32 opt)
{
OPT_topScope = OPT_universe;
OPT_OpenScope(0, NIL);
@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt)
void OPT_Close (void)
{
int16 i;
INT16 i;
OPT_CloseScope();
i = 0;
while (i < 64) {
@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
{
OPT_Object ob0 = NIL, ob1 = NIL;
BOOLEAN left;
int8 mnolev;
INT8 mnolev;
ob0 = OPT_topScope;
ob1 = ob0->right;
left = 0;
@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
*obj = ob1;
}
static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len)
static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
ch = name[__X(i, name__len)];
OPM_FPrint(&*fp, (int16)ch);
OPM_FPrint(&*fp, (INT16)ch);
i += 1;
} while (!(ch == 0x00));
}
@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp)
OPM_LogWLn();
}
static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par)
static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par)
{
OPT_IdFPrint(result);
OPM_FPrint(&*fp, result->idfp);
@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ)
{
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL;
int32 idfp;
int16 f, c;
INT32 idfp;
INT16 f, c;
if (!typ->idfpdone) {
typ->idfpdone = 1;
idfp = 0;
@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ)
}
static struct FPrintStr__15 {
int32 *pbfp, *pvfp;
INT32 *pbfp, *pvfp;
struct FPrintStr__15 *lnk;
} *FPrintStr__15_s;
static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr);
static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr);
static void FPrintTProcs__20 (OPT_Object obj);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr)
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr)
{
int32 i, j, n;
INT32 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
FPrintFlds__16(typ->link, adr, 0);
@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr)
}
}
static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible)
static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj)
void OPT_FPrintStr (OPT_Struct typ)
{
int16 f, c;
INT16 f, c;
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL, bstrobj = NIL;
int32 pbfp, pvfp;
INT32 pbfp, pvfp;
struct FPrintStr__15 _s;
_s.pbfp = &pbfp;
_s.pvfp = &pvfp;
@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ)
void OPT_FPrintObj (OPT_Object obj)
{
int32 fprint;
int16 f, m;
INT32 fprint;
INT16 f, m;
REAL rval;
OPT_ConstExt ext = NIL;
if (!obj->fpdone) {
@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj)
} else if (obj->mode == 9) {
OPT_FPrintSign(&fprint, obj->typ, obj->link);
ext = obj->conval->ext;
m = (int16)(*ext)[0];
m = (INT16)(*ext)[0];
f = 1;
OPM_FPrint(&fprint, m);
while (f <= m) {
OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]);
OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]);
f += 1;
}
} else if (obj->mode == 5) {
@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj)
}
}
void OPT_FPrintErr (OPT_Object obj, int16 errcode)
void OPT_FPrintErr (OPT_Object obj, INT16 errcode)
{
int16 i, j;
INT16 i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old)
static void OPT_InName (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_InMod (int8 *mno)
static void OPT_InMod (INT8 *mno)
{
OPT_Object head = NIL;
OPS_Name name;
int32 mn;
int8 i;
INT32 mn;
INT8 i;
mn = OPM_SymRInt();
if (mn == 0) {
*mno = OPT_impCtxt.glbmno[0];
@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno)
}
}
static void OPT_InConstant (int32 f, OPT_Const conval)
static void OPT_InConstant (INT32 f, OPT_Const conval)
{
CHAR ch;
int16 i;
INT16 i;
OPT_ConstExt ext = NIL;
REAL rval;
switch (f) {
case 1: case 3: case 2:
OPM_SymRCh(&ch);
conval->intval = (int16)ch;
conval->intval = (INT16)ch;
break;
case 4:
conval->intval = OPM_SymRInt();
@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval)
}
}
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par)
{
OPT_Object last = NIL, new = NIL;
int32 tag;
INT32 tag;
OPT_InStruct(&*res);
tag = OPM_SymRInt();
last = NIL;
@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void)
{
int32 tag;
INT32 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void)
return obj;
}
static OPT_Object OPT_InTProc (int8 mno)
static OPT_Object OPT_InTProc (INT8 mno)
{
int32 tag;
INT32 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno)
return obj;
}
static OPT_Struct OPT_InTyp (int32 tag)
static OPT_Struct OPT_InTyp (INT32 tag)
{
if (tag == 4) {
return OPT_IntType(OPM_SymRInt());
@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag)
static void OPT_InStruct (OPT_Struct *typ)
{
int8 mno;
int16 ref;
int32 tag;
INT8 mno;
INT16 ref;
INT32 tag;
OPS_Name name;
OPT_Struct t = NIL;
OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL;
@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (int16)OPM_SymRInt();
(*typ)->sysflag = (INT16)OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ)
}
}
static OPT_Object OPT_InObj (int8 mno)
static OPT_Object OPT_InObj (INT8 mno)
{
int16 i, s;
INT16 i, s;
CHAR ch;
OPT_Object obj = NIL, old = NIL;
OPT_Struct typ = NIL;
int32 tag;
INT32 tag;
OPT_ConstExt ext = NIL;
tag = OPT_impCtxt.nextTag;
if (tag == 19) {
@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (int16)OPM_SymRInt();
s = (INT16)OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno)
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
{
OPT_Object obj = NIL;
int8 mno;
INT8 mno;
OPS_Name aliasName__copy;
__DUPARR(aliasName, OPS_Name);
if (__STRCMP(name, "SYSTEM") == 0) {
@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
static void OPT_OutName (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_OutMod (int16 mno)
static void OPT_OutMod (INT16 mno)
{
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno)
}
}
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr)
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr)
{
int32 i, j, n;
INT32 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
OPT_OutFlds(typ->link, adr, 0);
@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr)
}
}
static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible)
static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ)
static void OPT_OutConstant (OPT_Object obj)
{
int16 f;
INT16 f;
REAL rval;
f = obj->typ->form;
OPM_SymWInt(f);
@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj)
static void OPT_OutObj (OPT_Object obj)
{
int16 i, j;
INT16 i, j;
OPT_ConstExt ext = NIL;
if (obj != NIL) {
OPT_OutObj(obj->left);
@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj)
OPM_SymWInt(33);
OPT_OutSign(obj->typ, obj->link);
ext = obj->conval->ext;
j = (int16)(*ext)[0];
j = (INT16)(*ext)[0];
i = 1;
OPM_SymWInt(j);
while (i <= j) {
@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj)
void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
{
int16 i;
int8 nofmod;
INT16 i;
INT8 nofmod;
BOOLEAN done;
OPT_symExtended = 0;
OPT_symNew = 0;
@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
}
}
static void OPT_InitStruct (OPT_Struct *typ, int8 form)
static void OPT_InitStruct (OPT_Struct *typ, INT8 form)
{
*typ = OPT_NewStr(form, 1);
(*typ)->ref = form;
@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
(*typ)->idfpdone = 1;
}
static void OPT_EnterBoolConst (OPS_Name name, int32 value)
static void OPT_EnterBoolConst (OPS_Name name, INT32 value)
{
OPT_Object obj = NIL;
OPS_Name name__copy;
@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value)
obj->conval->intval = value;
}
static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res)
static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res)
{
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res)
*res = obj;
}
static void OPT_EnterProc (OPS_Name name, int16 num)
static void OPT_EnterProc (OPS_Name name, INT16 num)
{
OPT_Object obj = NIL;
OPS_Name name__copy;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPT__h
#define OPT__h
@ -15,9 +15,9 @@ typedef
typedef
struct OPT_ConstDesc {
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint64 setval;
INT64 intval;
INT32 intval2;
UINT64 setval;
LONGREAL realval;
} OPT_ConstDesc;
@ -33,7 +33,7 @@ typedef
typedef
struct OPT_NodeDesc {
OPT_Node left, right, link;
int8 class, subcl;
INT8 class, subcl;
BOOLEAN readonly;
OPT_Struct typ;
OPT_Object obj;
@ -45,20 +45,20 @@ typedef
OPT_Object left, right, link, scope;
OPS_Name name;
BOOLEAN leaf;
int8 mode, mnolev, vis, history;
INT8 mode, mnolev, vis, history;
BOOLEAN used, fpdone;
int32 fprint;
INT32 fprint;
OPT_Struct typ;
OPT_Const conval;
int32 adr, linkadr;
int16 x;
INT32 adr, linkadr;
INT16 x;
} OPT_ObjDesc;
typedef
struct OPT_StrDesc {
int8 form, comp, mno, extlev;
int16 ref, sysflag;
int32 n, size, align, txtpos;
INT8 form, comp, mno, extlev;
INT16 ref, sysflag;
INT32 n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused;
char _prvt0[16];
OPT_Struct BaseTyp;
@ -69,22 +69,22 @@ typedef
import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
import int8 OPT_nofGmod;
import INT8 OPT_nofGmod;
import OPT_Object OPT_GlbMod[64];
import OPS_Name OPT_SelfName;
import BOOLEAN OPT_SYSimported;
import address *OPT_ConstDesc__typ;
import address *OPT_ObjDesc__typ;
import address *OPT_StrDesc__typ;
import address *OPT_NodeDesc__typ;
import ADDRESS *OPT_ConstDesc__typ;
import ADDRESS *OPT_ObjDesc__typ;
import ADDRESS *OPT_StrDesc__typ;
import ADDRESS *OPT_NodeDesc__typ;
import void OPT_Align (int32 *adr, int32 base);
import int32 OPT_BaseAlignment (OPT_Struct typ);
import void OPT_Align (INT32 *adr, INT32 base);
import INT32 OPT_BaseAlignment (OPT_Struct typ);
import void OPT_Close (void);
import void OPT_CloseScope (void);
import void OPT_Export (BOOLEAN *ext, BOOLEAN *new);
import void OPT_FPrintErr (OPT_Object obj, int16 errcode);
import void OPT_FPrintErr (OPT_Object obj, INT16 errcode);
import void OPT_FPrintObj (OPT_Object obj);
import void OPT_FPrintStr (OPT_Struct typ);
import void OPT_Find (OPT_Object *res);
@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
import void OPT_FindImport (OPT_Object mod, OPT_Object *res);
import void OPT_IdFPrint (OPT_Struct typ);
import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
import void OPT_Init (OPS_Name name, uint32 opt);
import void OPT_Init (OPS_Name name, UINT32 opt);
import void OPT_InitRecno (void);
import void OPT_Insert (OPS_Name name, OPT_Object *obj);
import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
import int16 OPT_IntSize (int64 n);
import OPT_Struct OPT_IntType (int32 size);
import INT16 OPT_IntSize (INT64 n);
import OPT_Struct OPT_IntType (INT32 size);
import OPT_Const OPT_NewConst (void);
import OPT_ConstExt OPT_NewExt (void);
import OPT_Node OPT_NewNode (int8 class);
import OPT_Node OPT_NewNode (INT8 class);
import OPT_Object OPT_NewObj (void);
import OPT_Struct OPT_NewStr (int8 form, int8 comp);
import void OPT_OpenScope (int8 level, OPT_Object owner);
import OPT_Struct OPT_SetType (int32 size);
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
import int32 OPT_SizeAlignment (int32 size);
import OPT_Struct OPT_NewStr (INT8 form, INT8 comp);
import void OPT_OpenScope (INT8 level, OPT_Object owner);
import OPT_Struct OPT_SetType (INT32 size);
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
import INT32 OPT_SizeAlignment (INT32 size);
import void OPT_TypSize (OPT_Struct typ);
import void *OPT__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPC.h"
@ -13,42 +13,42 @@
typedef
struct OPV_ExitInfo {
int16 level, label;
INT16 level, label;
} OPV_ExitInfo;
static int16 OPV_stamp;
static INT16 OPV_stamp;
static OPV_ExitInfo OPV_exit;
static int16 OPV_nofExitLabels;
static INT16 OPV_nofExitLabels;
export address *OPV_ExitInfo__typ;
export ADDRESS *OPV_ExitInfo__typ;
static void OPV_ActualPar (OPT_Node n, OPT_Object fp);
export void OPV_AdrAndSize (OPT_Object topScope);
static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc);
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec);
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec);
static void OPV_DefineTDescs (OPT_Node n);
static void OPV_Entier (OPT_Node n, int16 prec);
static void OPV_Entier (OPT_Node n, INT16 prec);
static void OPV_GetTProcNum (OPT_Object obj);
static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc);
static BOOLEAN OPV_ImplicitReturn (OPT_Node n);
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim);
static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim);
export void OPV_Init (void);
static void OPV_InitTDescs (OPT_Node n);
static void OPV_Len (OPT_Node n, int64 dim);
static void OPV_Len (OPT_Node n, INT64 dim);
export void OPV_Module (OPT_Node prog);
static void OPV_NewArr (OPT_Node d, OPT_Node x);
static void OPV_ParIntLiteral (int64 n, int32 size);
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp);
static void OPV_ParIntLiteral (INT64 n, INT32 size);
static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp);
static BOOLEAN OPV_SideEffects (OPT_Node n);
static void OPV_SizeCast (OPT_Node n, int32 to);
static void OPV_SizeCast (OPT_Node n, INT32 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);
static void OPV_TraverseRecord (OPT_Struct typ);
static void OPV_TypeOf (OPT_Node n);
static void OPV_design (OPT_Node n, int16 prec);
static void OPV_expr (OPT_Node n, int16 prec);
static void OPV_design (OPT_Node n, INT16 prec);
static void OPV_expr (OPT_Node n, INT16 prec);
static void OPV_stat (OPT_Node n, OPT_Object outerProc);
@ -60,7 +60,7 @@ void OPV_Init (void)
static void OPV_GetTProcNum (OPT_Object obj)
{
int32 oldPos;
INT32 oldPos;
OPT_Struct typ = NIL;
OPT_Object redef = NIL;
oldPos = OPM_errpos;
@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ)
static void OPV_Stamp (OPS_Name s)
{
int16 i, j, k;
INT16 i, j, k;
CHAR n[10];
OPV_stamp += 1;
i = 0;
@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s)
static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported)
{
int16 mode;
INT16 mode;
OPT_Object scope = NIL;
OPT_Struct typ = NIL;
if (obj != NIL) {
@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
OPT_sysptrtyp->strobj->linkadr = 2;
}
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp)
{
switch (class) {
case 7: case 0: case 2: case 4: case 9:
@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
__RETCHK;
}
static void OPV_Len (OPT_Node n, int64 dim)
static void OPV_Len (OPT_Node n, INT64 dim)
{
while ((n->class == 4 && n->typ->comp == 3)) {
dim += 1;
@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n)
__RETCHK;
}
static void OPV_Entier (OPT_Node n, int16 prec)
static void OPV_Entier (OPT_Node n, INT16 prec)
{
if (__IN(n->typ->form, 0x60, 32)) {
OPM_WriteString((CHAR*)"__ENTIER(", 10);
@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec)
}
}
static void OPV_SizeCast (OPT_Node n, int32 to)
static void OPV_SizeCast (OPT_Node n, INT32 to)
{
if ((to < n->typ->size && __IN(2, OPM_Options, 32))) {
OPM_WriteString((CHAR*)"__SHORT", 8);
@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to)
OPM_Write(')');
} else {
if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) {
OPM_WriteString((CHAR*)"(int", 5);
OPM_WriteString((CHAR*)"(INT", 5);
OPM_WriteInt(__ASHL(to, 3));
OPM_WriteString((CHAR*)")", 2);
}
}
}
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec)
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec)
{
int16 from, to;
INT16 from, to;
from = n->typ->form;
to = newtype->form;
if (to == 7) {
@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n)
}
}
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim)
{
if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
OPV_expr(n->right, prec);
@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
}
}
static void OPV_design (OPT_Node n, int16 prec)
static void OPV_design (OPT_Node n, INT16 prec)
{
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
int16 class, designPrec, comp;
INT16 class, designPrec, comp;
OPT_Node d = NIL, x = NIL;
int16 dims, i, _for__26;
INT16 dims, i, _for__26;
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)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) {
if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) {
designPrec = 9;
}
if (prec > designPrec) {
@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec)
if (__IN(3, OPM_Options, 32)) {
if (typ->comp == 4) {
OPM_WriteString((CHAR*)"__GUARDR(", 10);
if ((int16)obj->mnolev != OPM_level) {
if ((INT16)obj->mnolev != OPM_level) {
OPM_WriteStringVar((void*)obj->scope->name, 256);
OPM_WriteString((CHAR*)"__curr->", 9);
OPC_Ident(obj);
@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec)
}
}
static void OPV_ParIntLiteral (int64 n, int32 size)
static void OPV_ParIntLiteral (INT64 n, INT32 size)
{
OPM_WriteInt(n);
}
@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size)
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
{
OPT_Struct typ = NIL, aptyp = NIL;
int16 comp, form, mode, prec, dim;
INT16 comp, form, mode, prec, dim;
OPM_Write('(');
while (n != NIL) {
typ = fp->typ;
@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
return obj;
}
static void OPV_expr (OPT_Node n, int16 prec)
static void OPV_expr (OPT_Node n, INT16 prec)
{
int16 class, subclass, form, exprPrec;
INT16 class, subclass, form, exprPrec;
OPT_Struct typ = NIL;
OPT_Node l = NIL, r = NIL;
OPT_Object proc = NIL;
@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc)
OPT_Node if_ = NIL;
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
int32 adr;
INT32 adr;
if_ = n->left;
while (if_ != NIL) {
OPM_WriteString((CHAR*)"if ", 4);
@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc)
static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
{
OPT_Node switchCase = NIL, label = NIL;
int64 low, high;
int16 form, i;
INT64 low, high;
INT16 form, i;
OPM_WriteString((CHAR*)"switch ", 8);
OPV_expr(n->left, 12);
OPM_Write(' ');
@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
static void OPV_NewArr (OPT_Node d, OPT_Node x)
{
OPT_Struct typ = NIL, base = NIL;
int16 nofdim, nofdyn;
INT16 nofdim, nofdyn;
typ = d->typ->BaseTyp;
base = typ;
nofdim = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,37 +1,37 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Platform.h"
static CHAR Out_buf[128];
static int16 Out_in;
static INT16 Out_in;
export void Out_Char (CHAR ch);
export void Out_Flush (void);
export void Out_Int (int64 x, int64 n);
static int32 Out_Length (CHAR *s, LONGINT s__len);
export void Out_Int (INT64 x, INT64 n);
static INT32 Out_Length (CHAR *s, LONGINT s__len);
export void Out_Ln (void);
export void Out_LongReal (LONGREAL x, int16 n);
export void Out_LongReal (LONGREAL x, INT16 n);
export void Out_Open (void);
export void Out_Real (REAL x, int16 n);
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_);
export void Out_Real (REAL x, INT16 n);
static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_);
export void Out_String (CHAR *str, LONGINT str__len);
export LONGREAL Out_Ten (int16 e);
static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i);
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i);
export LONGREAL Out_Ten (INT16 e);
static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i);
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i);
#define Out_Entier64(x) (int64)(x)
void Out_Flush (void)
{
int16 error;
INT16 error;
if (Out_in > 0) {
error = Platform_Write(1, (address)Out_buf, Out_in);
}
@ -54,9 +54,9 @@ void Out_Char (CHAR ch)
}
}
static int32 Out_Length (CHAR *s, LONGINT s__len)
static INT32 Out_Length (CHAR *s, LONGINT s__len)
{
int32 l;
INT32 l;
l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1;
@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len)
void Out_String (CHAR *str, LONGINT str__len)
{
int32 l;
int16 error;
INT32 l;
INT16 error;
__DUP(str, str__len, CHAR);
l = Out_Length((void*)str, str__len);
if (Out_in + l > 128) {
@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len)
error = Platform_Write(1, (address)str, l);
} else {
__MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l);
Out_in += (int16)l;
Out_in += (INT16)l;
}
__DEL(str);
}
void Out_Int (int64 x, int64 n)
void Out_Int (INT64 x, INT64 n)
{
CHAR s[22];
int16 i;
INT16 i;
BOOLEAN negative;
negative = x < 0;
if (x == (-9223372036854775807-1)) {
@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n)
s[__X(i, 22)] = '-';
i += 1;
}
while (n > (int64)i) {
while (n > (INT64)i) {
Out_Char(' ');
n -= 1;
}
@ -124,22 +124,22 @@ void Out_Ln (void)
Out_Flush();
}
static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i)
static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i)
{
*i -= 1;
s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48);
}
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i)
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i)
{
int16 j;
int32 l;
INT16 j;
INT32 l;
__DUP(t, t__len, CHAR);
l = Out_Length((void*)t, t__len);
if (l > *i) {
l = *i;
}
*i -= (int16)l;
*i -= (INT16)l;
j = 0;
while (j < l) {
s[__X(*i + j, s__len)] = t[__X(j, t__len)];
@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
__DEL(t);
}
LONGREAL Out_Ten (int16 e)
LONGREAL Out_Ten (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e)
return r;
}
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_)
{
int16 e;
int64 f;
INT16 e;
INT64 f;
CHAR s[30];
int16 i, el;
INT16 i, el;
LONGREAL x0;
BOOLEAN nn, en;
int64 m;
int16 d, dr;
e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048);
f = __MASK((__VAL(int64, x)), -4503599627370496);
nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0)));
INT64 m;
INT16 d, dr;
e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048);
f = __MASK((__VAL(INT64, x)), -4503599627370496);
nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0)));
if (nn) {
n -= 1;
}
@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
if (nn) {
x = -x;
}
e = (int16)__ASHR((e - 1023) * 77, 8);
e = (INT16)__ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Out_Ten(e);
} else {
@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
}
}
void Out_Real (REAL x, int16 n)
void Out_Real (REAL x, INT16 n)
{
Out_RealP(x, n, 0);
}
void Out_LongReal (LONGREAL x, int16 n)
void Out_LongReal (LONGREAL x, INT16 n)
{
Out_RealP(x, n, 1);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Out__h
#define Out__h
@ -10,13 +10,13 @@
import void Out_Char (CHAR ch);
import void Out_Flush (void);
import void Out_Int (int64 x, int64 n);
import void Out_Int (INT64 x, INT64 n);
import void Out_Ln (void);
import void Out_LongReal (LONGREAL x, int16 n);
import void Out_LongReal (LONGREAL x, INT16 n);
import void Out_Open (void);
import void Out_Real (REAL x, int16 n);
import void Out_Real (REAL x, INT16 n);
import void Out_String (CHAR *str, LONGINT str__len);
import LONGREAL Out_Ten (int16 e);
import LONGREAL Out_Ten (INT16 e);
import void *Out__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -14,92 +14,92 @@ typedef
Platform_ArgPtr (*Platform_ArgVec)[1024];
typedef
int32 (*Platform_ArgVecPtr)[1];
INT32 (*Platform_ArgVecPtr)[1];
typedef
CHAR (*Platform_EnvPtr)[1024];
typedef
struct Platform_FileIdentity {
int32 volume, index, mtime;
INT32 volume, index, mtime;
} Platform_FileIdentity;
typedef
void (*Platform_HaltProcedure)(int32);
void (*Platform_HaltProcedure)(INT32);
typedef
void (*Platform_SignalHandler)(int32);
void (*Platform_SignalHandler)(INT32);
export BOOLEAN Platform_LittleEndian;
export int32 Platform_MainStackFrame;
export int32 Platform_HaltCode;
export int16 Platform_PID;
export INT32 Platform_MainStackFrame;
export INT32 Platform_HaltCode;
export INT16 Platform_PID;
export CHAR Platform_CWD[256];
export int16 Platform_ArgCount;
export int32 Platform_ArgVector;
export INT16 Platform_ArgCount;
export INT32 Platform_ArgVector;
static Platform_HaltProcedure Platform_HaltHandler;
static int32 Platform_TimeStart;
export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
static INT32 Platform_TimeStart;
export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
export CHAR Platform_NL[3];
export address *Platform_FileIdentity__typ;
export ADDRESS *Platform_FileIdentity__typ;
export BOOLEAN Platform_Absent (int16 e);
export int16 Platform_ArgPos (CHAR *s, LONGINT s__len);
export void Platform_AssertFail (int32 code);
export int16 Platform_Chdir (CHAR *n, LONGINT n__len);
export int16 Platform_Close (int32 h);
export BOOLEAN Platform_ConnectionFailed (int16 e);
export void Platform_Delay (int32 ms);
export BOOLEAN Platform_DifferentFilesystems (int16 e);
static void Platform_DisplayHaltCode (int32 code);
export int16 Platform_Error (void);
export void Platform_Exit (int16 code);
export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len);
export void Platform_GetClock (int32 *t, int32 *d);
export BOOLEAN Platform_Absent (INT16 e);
export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
export void Platform_AssertFail (INT32 code);
export INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
export INT16 Platform_Close (INT32 h);
export BOOLEAN Platform_ConnectionFailed (INT16 e);
export void Platform_Delay (INT32 ms);
export BOOLEAN Platform_DifferentFilesystems (INT16 e);
static void Platform_DisplayHaltCode (INT32 code);
export INT16 Platform_Error (void);
export void Platform_Exit (INT16 code);
export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
export void Platform_GetClock (INT32 *t, INT32 *d);
export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
export void Platform_GetIntArg (int16 n, int32 *val);
export void Platform_GetTimeOfDay (int32 *sec, int32 *usec);
export void Platform_Halt (int32 code);
export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ);
export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ);
export BOOLEAN Platform_Inaccessible (int16 e);
export void Platform_Init (int32 argc, int32 argvadr);
export BOOLEAN Platform_Interrupted (int16 e);
export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d);
export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h);
export BOOLEAN Platform_NoSuchDirectory (int16 e);
export int32 Platform_OSAllocate (int32 size);
export void Platform_OSFree (int32 address);
export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h);
export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h);
export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n);
export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n);
export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
export void Platform_GetIntArg (INT16 n, INT32 *val);
export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
export void Platform_Halt (INT32 code);
export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export BOOLEAN Platform_Inaccessible (INT16 e);
export void Platform_Init (INT32 argc, INT32 argvadr);
export BOOLEAN Platform_Interrupted (INT16 e);
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
export INT32 Platform_OSAllocate (INT32 size);
export void Platform_OSFree (INT32 address);
export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h);
export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h);
export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n);
export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n);
export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2);
export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
export int16 Platform_Seek (int32 h, int32 offset, int16 whence);
export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence);
export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source);
export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
export void Platform_SetQuitHandler (Platform_SignalHandler handler);
export int16 Platform_Size (int32 h, int32 *l);
export int16 Platform_Sync (int32 h);
export int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
export INT16 Platform_Size (INT32 h, INT32 *l);
export INT16 Platform_Sync (INT32 h);
export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len);
static void Platform_TestLittleEndian (void);
export int32 Platform_Time (void);
export BOOLEAN Platform_TimedOut (int16 e);
export BOOLEAN Platform_TooManyFiles (int16 e);
export int16 Platform_Truncate (int32 h, int32 l);
export int16 Platform_Unlink (CHAR *n, LONGINT n__len);
export int16 Platform_Write (int32 h, int32 p, int32 l);
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d);
export INT32 Platform_Time (void);
export BOOLEAN Platform_TimedOut (INT16 e);
export BOOLEAN Platform_TooManyFiles (INT16 e);
export INT16 Platform_Truncate (INT32 h, INT32 l);
export INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
export INT16 Platform_Write (INT32 h, INT32 p, INT32 l);
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d);
static void Platform_errch (CHAR c);
static void Platform_errint (int32 l);
static void Platform_errint (INT32 l);
static void Platform_errln (void);
static void Platform_errposint (int32 l);
static void Platform_errposint (INT32 l);
export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
#include <errno.h>
@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
#define Platform_EXDEV() EXDEV
extern void Heap_InitHeap();
#define Platform_HeapInitHeap() Heap_InitHeap()
#define Platform_allocate(size) (address)((void*)malloc((size_t)size))
#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size))
#define Platform_chdir(n, n__len) chdir((char*)n)
#define Platform_closefile(fd) close(fd)
#define Platform_err() errno
@ -147,13 +147,13 @@ extern void Heap_InitHeap();
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
#define Platform_openro(n, n__len) open((char*)n, O_RDONLY)
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l)
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l)
#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n)
#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s)
#define Platform_seekcur() SEEK_CUR
#define Platform_seekend() SEEK_END
#define Platform_seekset() SEEK_SET
#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h)
#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h)
#define Platform_stat(n, n__len) stat((char*)n, &s)
#define Platform_statdev() (LONGINT)s.st_dev
#define Platform_statino() (LONGINT)s.st_ino
@ -170,63 +170,63 @@ extern void Heap_InitHeap();
#define Platform_tvsec() tv.tv_sec
#define Platform_tvusec() tv.tv_usec
#define Platform_unlink(n, n__len) unlink((char*)n)
#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l)
#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l)
BOOLEAN Platform_TooManyFiles (int16 e)
BOOLEAN Platform_TooManyFiles (INT16 e)
{
return e == Platform_EMFILE() || e == Platform_ENFILE();
}
BOOLEAN Platform_NoSuchDirectory (int16 e)
BOOLEAN Platform_NoSuchDirectory (INT16 e)
{
return e == Platform_ENOENT();
}
BOOLEAN Platform_DifferentFilesystems (int16 e)
BOOLEAN Platform_DifferentFilesystems (INT16 e)
{
return e == Platform_EXDEV();
}
BOOLEAN Platform_Inaccessible (int16 e)
BOOLEAN Platform_Inaccessible (INT16 e)
{
return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
}
BOOLEAN Platform_Absent (int16 e)
BOOLEAN Platform_Absent (INT16 e)
{
return e == Platform_ENOENT();
}
BOOLEAN Platform_TimedOut (int16 e)
BOOLEAN Platform_TimedOut (INT16 e)
{
return e == Platform_ETIMEDOUT();
}
BOOLEAN Platform_ConnectionFailed (int16 e)
BOOLEAN Platform_ConnectionFailed (INT16 e)
{
return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
}
BOOLEAN Platform_Interrupted (int16 e)
BOOLEAN Platform_Interrupted (INT16 e)
{
return e == Platform_EINTR();
}
int32 Platform_OSAllocate (int32 size)
INT32 Platform_OSAllocate (INT32 size)
{
return Platform_allocate(size);
}
void Platform_OSFree (int32 address)
void Platform_OSFree (INT32 address)
{
Platform_free(address);
}
void Platform_Init (int32 argc, int32 argvadr)
void Platform_Init (INT32 argc, INT32 argvadr)
{
Platform_ArgVecPtr av = NIL;
Platform_MainStackFrame = argvadr;
Platform_ArgCount = __VAL(int16, argc);
Platform_ArgCount = __VAL(INT16, argc);
av = (Platform_ArgVecPtr)(address)argvadr;
Platform_ArgVector = (*av)[0];
Platform_HaltCode = -128;
@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
__DEL(var);
}
void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len)
{
Platform_ArgVec av = NIL;
if (n < Platform_ArgCount) {
@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
}
}
void Platform_GetIntArg (int16 n, int32 *val)
void Platform_GetIntArg (INT16 n, INT32 *val)
{
CHAR s[64];
int32 k, d, i;
INT32 k, d, i;
s[0] = 0x00;
Platform_GetArg(n, (void*)s, 64);
i = 0;
@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val)
i = 1;
}
k = 0;
d = (int16)s[__X(i, 64)] - 48;
d = (INT16)s[__X(i, 64)] - 48;
while ((d >= 0 && d <= 9)) {
k = k * 10 + d;
i += 1;
d = (int16)s[__X(i, 64)] - 48;
d = (INT16)s[__X(i, 64)] - 48;
}
if (s[0] == '-') {
k = -k;
@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val)
}
}
int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
INT16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
CHAR arg[256];
__DUP(s, s__len, CHAR);
i = 0;
@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
Platform_sethandler(4, handler);
}
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d)
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d)
{
*d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se;
}
void Platform_GetClock (int32 *t, int32 *d)
void Platform_GetClock (INT32 *t, INT32 *d)
{
Platform_gettimeval();
Platform_sectotm(Platform_tvsec());
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
}
void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec)
{
Platform_gettimeval();
*sec = Platform_tvsec();
*usec = Platform_tvusec();
}
int32 Platform_Time (void)
INT32 Platform_Time (void)
{
int32 ms;
INT32 ms;
Platform_gettimeval();
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
return (int)__MOD(ms - Platform_TimeStart, 2147483647);
}
void Platform_Delay (int32 ms)
void Platform_Delay (INT32 ms)
{
int32 s, ns;
INT32 s, ns;
s = __DIV(ms, 1000);
ns = (int)__MOD(ms, 1000) * 1000000;
Platform_nanosleep(s, ns);
}
int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
INT16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{
__DUP(cmd, cmd__len, CHAR);
__DEL(cmd);
return Platform_system(cmd, cmd__len);
}
int16 Platform_Error (void)
INT16 Platform_Error (void)
{
return Platform_err();
}
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_openro(n, n__len);
if (fd < 0) {
return Platform_err();
@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_openrw(n, n__len);
if (fd < 0) {
return Platform_err();
@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_opennew(n, n__len);
if (fd < 0) {
return Platform_err();
@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_Close (int32 h)
INT16 Platform_Close (INT32 h)
{
if (Platform_closefile(h) < 0) {
return Platform_err();
@ -416,7 +416,7 @@ int16 Platform_Close (int32 h)
__RETCHK;
}
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
{
Platform_structstats();
if (Platform_fstat(h) < 0) {
@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden
return 0;
}
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ)
{
__DUP(n, n__len, CHAR);
Platform_structstats();
@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i
return i1.mtime == i2.mtime;
}
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source)
{
(*target).mtime = source.mtime;
}
void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d)
{
Platform_sectotm(i.mtime);
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
}
int16 Platform_Size (int32 h, int32 *l)
INT16 Platform_Size (INT32 h, INT32 *l)
{
Platform_structstats();
if (Platform_fstat(h) < 0) {
@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l)
return 0;
}
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n)
{
*n = Platform_readfile(h, p, l);
if (*n < 0) {
@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
__RETCHK;
}
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n)
{
*n = Platform_readfile(h, (address)b, b__len);
if (*n < 0) {
@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
__RETCHK;
}
int16 Platform_Write (int32 h, int32 p, int32 l)
INT16 Platform_Write (INT32 h, INT32 p, INT32 l)
{
int32 written;
INT32 written;
written = Platform_writefile(h, p, l);
if (written < 0) {
return Platform_err();
@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l)
__RETCHK;
}
int16 Platform_Sync (int32 h)
INT16 Platform_Sync (INT32 h)
{
if (Platform_fsync(h) < 0) {
return Platform_err();
@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h)
__RETCHK;
}
int16 Platform_Seek (int32 h, int32 offset, int16 whence)
INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence)
{
if (Platform_lseek(h, offset, whence) < 0) {
return Platform_err();
@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence)
__RETCHK;
}
int16 Platform_Truncate (int32 h, int32 l)
INT16 Platform_Truncate (INT32 h, INT32 l)
{
if (Platform_ftruncate(h, l) < 0) {
return Platform_err();
@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l)
__RETCHK;
}
int16 Platform_Unlink (CHAR *n, LONGINT n__len)
INT16 Platform_Unlink (CHAR *n, LONGINT n__len)
{
if (Platform_unlink(n, n__len) < 0) {
return Platform_err();
@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len)
__RETCHK;
}
int16 Platform_Chdir (CHAR *n, LONGINT n__len)
INT16 Platform_Chdir (CHAR *n, LONGINT n__len)
{
int16 r;
INT16 r;
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
return 0;
} else {
@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len)
__RETCHK;
}
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{
if (Platform_rename(o, o__len, n, n__len) < 0) {
return Platform_err();
@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
__RETCHK;
}
void Platform_Exit (int16 code)
void Platform_Exit (INT16 code)
{
Platform_exit(code);
}
@ -586,7 +586,7 @@ static void Platform_errln (void)
Platform_errch(0x0a);
}
static void Platform_errposint (int32 l)
static void Platform_errposint (INT32 l)
{
if (l > 10) {
Platform_errposint(__DIV(l, 10));
@ -594,7 +594,7 @@ static void Platform_errposint (int32 l)
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
static void Platform_errint (int32 l)
static void Platform_errint (INT32 l)
{
if (l < 0) {
Platform_errch('-');
@ -603,7 +603,7 @@ static void Platform_errint (int32 l)
Platform_errposint(l);
}
static void Platform_DisplayHaltCode (int32 code)
static void Platform_DisplayHaltCode (INT32 code)
{
switch (code) {
case -1:
@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code)
}
}
void Platform_Halt (int32 code)
void Platform_Halt (INT32 code)
{
Platform_HaltCode = code;
if (Platform_HaltHandler != NIL) {
@ -672,10 +672,10 @@ void Platform_Halt (int32 code)
Platform_DisplayHaltCode(code);
}
Platform_errln();
Platform_exit(__VAL(int16, code));
Platform_exit(__VAL(INT16, code));
}
void Platform_AssertFail (int32 code)
void Platform_AssertFail (INT32 code)
{
Platform_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code)
Platform_errstring((CHAR*)".", 2);
}
Platform_errln();
Platform_exit(__VAL(int16, code));
Platform_exit(__VAL(INT16, code));
}
void Platform_SetHalt (Platform_HaltProcedure p)
@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p)
static void Platform_TestLittleEndian (void)
{
int16 i;
INT16 i;
i = 1;
__GET((address)&i, Platform_LittleEndian, BOOLEAN);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Platform__h
#define Platform__h
@ -7,77 +7,77 @@
typedef
struct Platform_FileIdentity {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[8];
} Platform_FileIdentity;
typedef
void (*Platform_HaltProcedure)(int32);
void (*Platform_HaltProcedure)(INT32);
typedef
void (*Platform_SignalHandler)(int32);
void (*Platform_SignalHandler)(INT32);
import BOOLEAN Platform_LittleEndian;
import int32 Platform_MainStackFrame;
import int32 Platform_HaltCode;
import int16 Platform_PID;
import INT32 Platform_MainStackFrame;
import INT32 Platform_HaltCode;
import INT16 Platform_PID;
import CHAR Platform_CWD[256];
import int16 Platform_ArgCount;
import int32 Platform_ArgVector;
import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
import INT16 Platform_ArgCount;
import INT32 Platform_ArgVector;
import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
import CHAR Platform_NL[3];
import address *Platform_FileIdentity__typ;
import ADDRESS *Platform_FileIdentity__typ;
import BOOLEAN Platform_Absent (int16 e);
import int16 Platform_ArgPos (CHAR *s, LONGINT s__len);
import void Platform_AssertFail (int32 code);
import int16 Platform_Chdir (CHAR *n, LONGINT n__len);
import int16 Platform_Close (int32 h);
import BOOLEAN Platform_ConnectionFailed (int16 e);
import void Platform_Delay (int32 ms);
import BOOLEAN Platform_DifferentFilesystems (int16 e);
import int16 Platform_Error (void);
import void Platform_Exit (int16 code);
import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len);
import void Platform_GetClock (int32 *t, int32 *d);
import BOOLEAN Platform_Absent (INT16 e);
import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
import void Platform_AssertFail (INT32 code);
import INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
import INT16 Platform_Close (INT32 h);
import BOOLEAN Platform_ConnectionFailed (INT16 e);
import void Platform_Delay (INT32 ms);
import BOOLEAN Platform_DifferentFilesystems (INT16 e);
import INT16 Platform_Error (void);
import void Platform_Exit (INT16 code);
import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
import void Platform_GetClock (INT32 *t, INT32 *d);
import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void Platform_GetIntArg (int16 n, int32 *val);
import void Platform_GetTimeOfDay (int32 *sec, int32 *usec);
import void Platform_Halt (int32 code);
import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ);
import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ);
import BOOLEAN Platform_Inaccessible (int16 e);
import void Platform_Init (int32 argc, int32 argvadr);
import BOOLEAN Platform_Interrupted (int16 e);
import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d);
import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h);
import BOOLEAN Platform_NoSuchDirectory (int16 e);
import int32 Platform_OSAllocate (int32 size);
import void Platform_OSFree (int32 address);
import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h);
import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h);
import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n);
import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n);
import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
import void Platform_GetIntArg (INT16 n, INT32 *val);
import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
import void Platform_Halt (INT32 code);
import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import BOOLEAN Platform_Inaccessible (INT16 e);
import void Platform_Init (INT32 argc, INT32 argvadr);
import BOOLEAN Platform_Interrupted (INT16 e);
import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
import BOOLEAN Platform_NoSuchDirectory (INT16 e);
import INT32 Platform_OSAllocate (INT32 size);
import void Platform_OSFree (INT32 address);
import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h);
import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h);
import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n);
import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n);
import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2);
import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
import int16 Platform_Seek (int32 h, int32 offset, int16 whence);
import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence);
import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetInterruptHandler (Platform_SignalHandler handler);
import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source);
import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
import void Platform_SetQuitHandler (Platform_SignalHandler handler);
import int16 Platform_Size (int32 h, int32 *l);
import int16 Platform_Sync (int32 h);
import int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import int32 Platform_Time (void);
import BOOLEAN Platform_TimedOut (int16 e);
import BOOLEAN Platform_TooManyFiles (int16 e);
import int16 Platform_Truncate (int32 h, int32 l);
import int16 Platform_Unlink (CHAR *n, LONGINT n__len);
import int16 Platform_Write (int32 h, int32 p, int32 l);
import INT16 Platform_Size (INT32 h, INT32 *l);
import INT16 Platform_Sync (INT32 h);
import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import INT32 Platform_Time (void);
import BOOLEAN Platform_TimedOut (INT16 e);
import BOOLEAN Platform_TooManyFiles (INT16 e);
import INT16 Platform_Truncate (INT32 h, INT32 l);
import INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
import INT16 Platform_Write (INT32 h, INT32 p, INT32 l);
import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void *Platform__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -11,19 +11,19 @@
static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len);
export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len);
export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len);
export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len);
export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len);
export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len);
export int16 Reals_Expo (REAL x);
export int16 Reals_ExpoL (LONGREAL x);
export void Reals_SetExpo (REAL *x, int16 ex);
export REAL Reals_Ten (int16 e);
export LONGREAL Reals_TenL (int16 e);
static CHAR Reals_ToHex (int16 i);
export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len);
export INT16 Reals_Expo (REAL x);
export INT16 Reals_ExpoL (LONGREAL x);
export void Reals_SetExpo (REAL *x, INT16 ex);
export REAL Reals_Ten (INT16 e);
export LONGREAL Reals_TenL (INT16 e);
static CHAR Reals_ToHex (INT16 i);
REAL Reals_Ten (int16 e)
REAL Reals_Ten (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e)
return r;
}
LONGREAL Reals_TenL (int16 e)
LONGREAL Reals_TenL (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e)
__RETCHK;
}
int16 Reals_Expo (REAL x)
INT16 Reals_Expo (REAL x)
{
int16 i;
__GET((address)&x + 2, i, int16);
INT16 i;
__GET((address)&x + 2, i, INT16);
return __MASK(__ASHR(i, 7), -256);
}
void Reals_SetExpo (REAL *x, int16 ex)
void Reals_SetExpo (REAL *x, INT16 ex)
{
CHAR c;
__GET((address)x + 3, c, CHAR);
__PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((address)x + 2, c, CHAR);
__PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
__PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
}
int16 Reals_ExpoL (LONGREAL x)
INT16 Reals_ExpoL (LONGREAL x)
{
int16 i;
__GET((address)&x + 6, i, int16);
INT16 i;
__GET((address)&x + 6, i, INT16);
return __MASK(__ASHR(i, 4), -2048);
}
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len)
{
int32 i, j, k;
INT32 i, j, k;
if (x < (LONGREAL)0) {
x = -x;
}
k = 0;
if (n > 9) {
i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (int32)__ENTIER(x - i * (LONGREAL)1000000000);
i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000);
if (j < 0) {
j = 0;
}
@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
k += 1;
}
} else {
i = (int32)__ENTIER(x);
i = (INT32)__ENTIER(x);
}
while (k < n) {
d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
}
}
void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len)
{
Reals_ConvertL(x, n, (void*)d, d__len);
}
static CHAR Reals_ToHex (int16 i)
static CHAR Reals_ToHex (INT16 i)
{
if (i < 10) {
return (CHAR)(i + 48);
@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i)
static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len)
{
int16 i;
int32 l;
INT16 i;
INT32 l;
CHAR by;
i = 0;
l = b__len;
while (i < l) {
by = __VAL(CHAR, b[__X(i, b__len)]);
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16));
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16));
i += 1;
}
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Reals__h
#define Reals__h
@ -8,15 +8,15 @@
import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len);
import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len);
import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len);
import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len);
import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len);
import int16 Reals_Expo (REAL x);
import int16 Reals_ExpoL (LONGREAL x);
import void Reals_SetExpo (REAL *x, int16 ex);
import REAL Reals_Ten (int16 e);
import LONGREAL Reals_TenL (int16 e);
import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len);
import INT16 Reals_Expo (REAL x);
import INT16 Reals_ExpoL (LONGREAL x);
import void Reals_SetExpo (REAL *x, INT16 ex);
import REAL Reals_Ten (INT16 e);
import LONGREAL Reals_TenL (INT16 e);
import void *Reals__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -12,18 +12,18 @@
export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len);
export void Strings_Cap (CHAR *s, LONGINT s__len);
export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n);
export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len);
export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
export int16 Strings_Length (CHAR *s, LONGINT s__len);
export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n);
export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len);
export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
export INT16 Strings_Length (CHAR *s, LONGINT s__len);
export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len);
export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos);
export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos);
export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
int16 Strings_Length (CHAR *s, LONGINT s__len)
INT16 Strings_Length (CHAR *s, LONGINT s__len)
{
int32 i;
INT32 i;
__DUP(s, s__len, CHAR);
i = 0;
while ((i < s__len && s[__X(i, s__len)] != 0x00)) {
@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
}
if (i <= 32767) {
__DEL(s);
return (int16)i;
return (INT16)i;
} else {
__DEL(s);
return 32767;
@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len)
{
int16 n1, n2, i;
INT16 n1, n2, i;
__DUP(extra, extra__len, CHAR);
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(extra, extra__len);
@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__
__DEL(extra);
}
void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len)
void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len)
{
int16 n1, n2, i;
INT16 n1, n2, i;
__DUP(source, source__len, CHAR);
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(source, source__len);
@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
__DEL(source);
}
void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n)
void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n)
{
int16 len, i;
INT16 len, i;
len = Strings_Length(s, s__len);
if (pos < 0) {
pos = 0;
@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n)
}
}
void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len)
void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len)
{
__DUP(source, source__len, CHAR);
Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len));
@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest,
__DEL(source);
}
void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len)
void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len)
{
int16 len, destLen, i;
INT16 len, destLen, i;
__DUP(source, source__len, CHAR);
len = Strings_Length(source, source__len);
destLen = (int16)dest__len - 1;
destLen = (INT16)dest__len - 1;
if (pos < 0) {
pos = 0;
}
@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
__DEL(source);
}
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos)
{
int16 n1, n2, i, j;
INT16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len);
@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
void Strings_Cap (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) {
@ -191,9 +191,9 @@ static struct Match__7 {
struct Match__7 *lnk;
} *Match__7_s;
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m);
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m);
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m)
{
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Strings__h
#define Strings__h
@ -10,13 +10,13 @@
import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len);
import void Strings_Cap (CHAR *s, LONGINT s__len);
import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n);
import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len);
import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
import int16 Strings_Length (CHAR *s, LONGINT s__len);
import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n);
import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len);
import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
import INT16 Strings_Length (CHAR *s, LONGINT s__len);
import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len);
import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos);
import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos);
import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
import void *Strings__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Files.h"
@ -19,9 +19,9 @@ typedef
typedef
struct Texts_RunDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
} Texts_RunDesc;
@ -34,7 +34,7 @@ typedef
} Texts_ElemMsg;
typedef
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *);
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *);
typedef
struct Texts_TextDesc *Texts_Text;
@ -42,26 +42,26 @@ typedef
typedef
struct Texts_ElemDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
int32 W, H;
INT32 W, H;
Texts_Handler handle;
Texts_Text base;
} Texts_ElemDesc;
struct Texts__1 { /* Texts_ElemDesc */
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
int32 W, H;
INT32 W, H;
Texts_Handler handle;
Texts_Text base;
Files_File file;
int32 org, span;
INT32 org, span;
CHAR mod[32], proc[32];
};
@ -70,7 +70,7 @@ typedef
typedef
struct Texts_BufDesc {
int32 len;
INT32 len;
Texts_Run head;
} Texts_BufDesc;
@ -84,8 +84,8 @@ typedef
typedef
struct Texts_FileMsg { /* Texts_ElemMsg */
int16 id;
int32 pos;
INT16 id;
INT32 pos;
Files_Rider r;
} Texts_FileMsg;
@ -100,7 +100,7 @@ typedef
} Texts_IdentifyMsg;
typedef
void (*Texts_Notifier)(Texts_Text, int16, int32, int32);
void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32);
typedef
struct Texts_PieceDesc *Texts_Piece;
@ -108,57 +108,57 @@ typedef
typedef
struct Texts_PieceDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
Files_File file;
int32 org;
INT32 org;
} Texts_PieceDesc;
typedef
struct Texts_Reader {
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
Files_Rider rider;
Texts_Run run;
int32 org, off;
INT32 org, off;
} Texts_Reader;
typedef
struct Texts_Scanner { /* Texts_Reader */
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
Files_Rider rider;
Texts_Run run;
int32 org, off;
INT32 org, off;
CHAR nextCh;
int16 line, class;
int32 i;
INT16 line, class;
INT32 i;
REAL x;
LONGREAL y;
CHAR c;
int8 len;
INT8 len;
CHAR s[64];
} Texts_Scanner;
typedef
struct Texts_TextDesc {
int32 len;
INT32 len;
Texts_Notifier notify;
Texts_Run head, cache;
int32 corg;
INT32 corg;
} Texts_TextDesc;
typedef
struct Texts_Writer {
Texts_Buffer buf;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Files_Rider rider;
Files_File file;
} Texts_Writer;
@ -168,68 +168,68 @@ export Texts_Elem Texts_new;
static Texts_Buffer Texts_del;
static Texts_FontsFont Texts_FontsDefault;
export address *Texts_FontDesc__typ;
export address *Texts_RunDesc__typ;
export address *Texts_PieceDesc__typ;
export address *Texts_ElemMsg__typ;
export address *Texts_ElemDesc__typ;
export address *Texts_FileMsg__typ;
export address *Texts_CopyMsg__typ;
export address *Texts_IdentifyMsg__typ;
export address *Texts_BufDesc__typ;
export address *Texts_TextDesc__typ;
export address *Texts_Reader__typ;
export address *Texts_Scanner__typ;
export address *Texts_Writer__typ;
export address *Texts__1__typ;
export ADDRESS *Texts_FontDesc__typ;
export ADDRESS *Texts_RunDesc__typ;
export ADDRESS *Texts_PieceDesc__typ;
export ADDRESS *Texts_ElemMsg__typ;
export ADDRESS *Texts_ElemDesc__typ;
export ADDRESS *Texts_FileMsg__typ;
export ADDRESS *Texts_CopyMsg__typ;
export ADDRESS *Texts_IdentifyMsg__typ;
export ADDRESS *Texts_BufDesc__typ;
export ADDRESS *Texts_TextDesc__typ;
export ADDRESS *Texts_Reader__typ;
export ADDRESS *Texts_Scanner__typ;
export ADDRESS *Texts_Writer__typ;
export ADDRESS *Texts__1__typ;
export void Texts_Append (Texts_Text T, Texts_Buffer B);
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff);
static Texts_Elem Texts_CloneElem (Texts_Elem e);
static Texts_Piece Texts_ClonePiece (Texts_Piece p);
export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
export void Texts_Delete (Texts_Text T, int32 beg, int32 end);
export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
export Texts_Text Texts_ElemBase (Texts_Elem E);
export int32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off);
export INT32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off);
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len);
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ);
export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B);
export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T);
static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T);
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ);
export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);
export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v);
export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len);
export void Texts_OpenBuf (Texts_Buffer B);
export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos);
export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos);
export void Texts_OpenWriter (Texts_Writer *W, address *W__typ);
export int32 Texts_Pos (Texts_Reader *R, address *R__typ);
export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch);
export void Texts_ReadElem (Texts_Reader *R, address *R__typ);
export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ);
export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos);
export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos);
export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ);
export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch);
export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_Recall (Texts_Buffer *B);
export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B);
export void Texts_Scan (Texts_Scanner *S, address *S__typ);
export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col);
export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt);
export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff);
export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B);
export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ);
export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col);
export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt);
export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff);
static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base);
static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un);
export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T);
export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch);
export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d);
export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e);
export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x);
export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n);
export void Texts_WriteLn (Texts_Writer *W, address *W__typ);
export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n);
export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x);
export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n);
export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k);
export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len);
static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un);
export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch);
export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d);
export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e);
export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x);
export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n);
export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ);
export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n);
export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x);
export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n);
export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k);
export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len);
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
return F;
}
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off)
{
Texts_Run v = NIL;
int32 m;
INT32 m;
if (*pos >= T->len) {
*pos = T->len;
*u = T->head;
@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3
}
}
static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un)
static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un)
{
Texts_Piece p = NIL, U = NIL;
if (off == 0) {
@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E)
return E->base;
}
int32 Texts_ElemPos (Texts_Elem E)
INT32 Texts_ElemPos (Texts_Elem E)
{
Texts_Run u = NIL;
int32 pos;
INT32 pos;
u = E->base->head->next;
pos = 0;
while (u != (void *) E) {
@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E)
return pos;
}
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ)
{
Texts_Alien e = NIL;
Files_Rider r;
int32 i;
INT32 i;
CHAR ch;
if (__ISP(E, Texts__1, 2)) {
if (__IS(msg__typ, Texts_CopyMsg, 1)) {
@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B)
Texts_del = NIL;
}
void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B)
void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B)
{
Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL;
int32 uo, ud, vo, vd;
INT32 uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Find(T, &end, &v, &vo, &vd);
w = B->head->prev;
@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B)
B->len += end - beg;
}
void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B)
void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B)
{
Texts_Run u = NIL, un = NIL, v = NIL;
Texts_Piece p = NIL, q = NIL;
int32 uo, ud, len;
INT32 uo, ud, len;
Texts_Find(T, &pos, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
len = B->len;
@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B)
void Texts_Append (Texts_Text T, Texts_Buffer B)
{
Texts_Run v = NIL;
int32 pos, len;
INT32 pos, len;
pos = T->len;
len = B->len;
v = B->head->next;
@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B)
}
}
void Texts_Delete (Texts_Text T, int32 beg, int32 end)
void Texts_Delete (Texts_Text T, INT32 beg, INT32 end)
{
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
int32 co, uo, ud, vo, vd;
INT32 co, uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
c = T->cache;
@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end)
}
}
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff)
void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff)
{
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
int32 co, uo, ud, vo, vd;
INT32 co, uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
c = T->cache;
@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo
}
}
void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos)
void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos)
{
Texts_Run u = NIL;
if (pos >= T->len) {
@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos
}
}
void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch)
void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch)
{
Texts_Run u = NIL;
int32 pos;
INT32 pos;
CHAR nextch;
u = (*R).run;
(*R).fnt = u->fnt;
@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch)
}
}
void Texts_ReadElem (Texts_Reader *R, address *R__typ)
void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ)
{
Texts_Run u = NIL, un = NIL;
u = (*R).run;
@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ)
}
}
void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ)
{
Texts_Run u = NIL;
u = (*R).run->prev;
@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
}
}
int32 Texts_Pos (Texts_Reader *R, address *R__typ)
INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ)
{
return (*R).org + (*R).off;
}
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)
void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos)
{
Texts_OpenReader((void*)&*S, S__typ, T, pos);
(*S).line = 0;
@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p
static struct Scan__31 {
Texts_Scanner *S;
address *S__typ;
ADDRESS *S__typ;
CHAR *ch;
BOOLEAN *negE;
int16 *e;
INT16 *e;
struct Scan__31 *lnk;
} *Scan__31_s;
@ -740,18 +740,18 @@ 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 + (int16)*Scan__31_s->ch) - 48;
*Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
void Texts_Scan (Texts_Scanner *S, address *S__typ)
void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
{
CHAR ch, term;
BOOLEAN neg, negE, hex;
int8 i, j, h;
int16 e;
int32 k;
INT8 i, j, h;
INT16 e;
INT32 k;
REAL x, f;
LONGREAL y, g;
CHAR d[32];
@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
if ('9' < ch) {
if (('A' <= ch && ch <= 'F')) {
hex = 1;
ch = (CHAR)((int16)ch - 7);
ch = (CHAR)((INT16)ch - 7);
} else if (('a' <= ch && ch <= 'f')) {
hex = 1;
ch = (CHAR)((int16)ch - 39);
ch = (CHAR)((INT16)ch - 39);
} else {
break;
}
@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
if (i - j > 8) {
j = i - 8;
}
k = (int16)d[__X(j, 32)] - 48;
k = (INT16)d[__X(j, 32)] - 48;
j += 1;
if ((i - j == 7 && k >= 8)) {
k -= 16;
}
while (j < i) {
k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48);
k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48);
j += 1;
}
if (neg) {
@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
y = (LONGREAL)0;
g = (LONGREAL)1;
do {
y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48);
y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
g = g / (LONGREAL)(LONGREAL)10;
y = ((int16)d[__X(j, 32)] - 48) * g + y;
y = ((INT16)d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__32();
@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
x = (REAL)0;
f = (REAL)1;
do {
x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48);
x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
f = f / (REAL)(REAL)10;
x = ((int16)d[__X(j, 32)] - 48) * f + x;
x = ((INT16)d[__X(j, 32)] - 48) * f + x;
j += 1;
}
if (ch == 'E') {
@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
(*S).class = 3;
k = 0;
do {
k = k * 10 + ((int16)d[__X(j, 32)] - 48);
k = k * 10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == i));
if (neg) {
@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
Scan__31_s = _s.lnk;
}
void Texts_OpenWriter (Texts_Writer *W, address *W__typ)
void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ)
{
__NEW((*W).buf, Texts_BufDesc);
Texts_OpenBuf((*W).buf);
@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ)
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0);
}
void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt)
void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt)
{
(*W).fnt = fnt;
}
void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col)
void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col)
{
(*W).col = col;
}
void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff)
void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff)
{
(*W).voff = voff;
}
void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch)
void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch)
{
Texts_Run u = NIL, un = NIL;
Texts_Piece p = NIL;
@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch)
}
}
void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e)
void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e)
{
Texts_Run u = NIL, un = NIL;
if (e->base != NIL) {
@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e)
un->prev = (Texts_Run)e;
}
void Texts_WriteLn (Texts_Writer *W, address *W__typ)
void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ)
{
Texts_Write(&*W, W__typ, 0x0d);
}
void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len)
void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
i = 0;
while (s[__X(i, s__len)] >= ' ') {
@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le
__DEL(s);
}
void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n)
{
int16 i;
int64 x0;
INT16 i;
INT64 x0;
CHAR a[24];
i = 0;
if (x < 0) {
@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
x0 = __DIV(x0, 10);
i += 1;
} while (!(x0 == 0));
while (n > (int64)i) {
while (n > (INT64)i) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
}
@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
} while (!(i == 0));
}
void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x)
void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x)
{
int16 i;
int32 y;
INT16 i;
INT32 y;
CHAR a[20];
i = 0;
Texts_Write(&*W, W__typ, ' ');
@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x)
} while (!(i == 0));
}
void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n)
void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n)
{
int16 e;
INT16 e;
REAL x0;
CHAR d[9];
e = Reals_Expo(x);
@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n)
static struct WriteRealFix__53 {
Texts_Writer *W;
address *W__typ;
int16 *i;
ADDRESS *W__typ;
INT16 *i;
CHAR (*d)[9];
struct WriteRealFix__53 *lnk;
} *WriteRealFix__53_s;
static void dig__54 (int16 n);
static void seq__56 (CHAR ch, int16 n);
static void dig__54 (INT16 n);
static void seq__56 (CHAR ch, INT16 n);
static void seq__56 (CHAR ch, int16 n)
static void seq__56 (CHAR ch, INT16 n)
{
while (n > 0) {
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch);
@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n)
}
}
static void dig__54 (int16 n)
static void dig__54 (INT16 n)
{
while (n > 0) {
*WriteRealFix__53_s->i -= 1;
@ -1195,9 +1195,9 @@ static void dig__54 (int16 n)
}
}
void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k)
void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k)
{
int16 e, i;
INT16 e, i;
CHAR sign;
REAL x0;
CHAR d[9];
@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1
WriteRealFix__53_s = _s.lnk;
}
void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x)
void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x)
{
int16 i;
INT16 i;
CHAR d[8];
Reals_ConvertH(x, (void*)d, 8);
i = 0;
@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x)
} while (!(i == 8));
}
void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n)
{
int16 e;
INT16 e;
LONGREAL x0;
CHAR d[16];
e = Reals_ExpoL(x);
@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
} else {
Texts_Write(&*W, W__typ, ' ');
}
e = (int16)__ASHR((e - 1023) * 77, 8);
e = (INT16)__ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Reals_TenL(e);
} else {
@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
}
}
void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x)
void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x)
{
int16 i;
INT16 i;
CHAR d[16];
Reals_ConvertHL(x, (void*)d, 16);
i = 0;
@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x)
static struct WriteDate__43 {
Texts_Writer *W;
address *W__typ;
ADDRESS *W__typ;
struct WriteDate__43 *lnk;
} *WriteDate__43_s;
static void WritePair__44 (CHAR ch, int32 x);
static void WritePair__44 (CHAR ch, INT32 x);
static void WritePair__44 (CHAR ch, int32 x)
static void WritePair__44 (CHAR ch, INT32 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)((int)__MOD(x, 10) + 48));
}
void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d)
void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d)
{
struct WriteDate__43 _s;
_s.W = W; _s.W__typ = W__typ;
@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d)
static struct Load0__16 {
Texts_Text *T;
int8 *ecnt;
INT8 *ecnt;
Files_File *f;
Texts_FileMsg *msg;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Load0__16 *lnk;
} *Load0__16_s;
static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e);
static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e);
static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e)
static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e)
{
Modules_Module M = NIL;
Modules_Command Cmd;
Texts_Alien a = NIL;
int32 org, ew, eh;
int8 eno;
INT32 org, ew, eh;
INT8 eno;
Texts_new = NIL;
Files_ReadLInt(&*r, r__typ, &ew);
Files_ReadLInt(&*r, r__typ, &eh);
@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span
}
}
static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
Texts_Run u = NIL, un = NIL;
Texts_Piece p = NIL;
Texts_Elem e = NIL;
int32 org, pos, hlen, plen;
int8 ecnt, fcnt, fno, col, voff;
INT32 org, pos, hlen, plen;
INT8 ecnt, fcnt, fno, col, voff;
Files_File f = NIL;
Texts_FileMsg msg;
CHAR mods[64][32], procs[64][32];
@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
Load0__16_s = _s.lnk;
}
void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T)
void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
int16 tag;
INT16 tag;
Files_ReadInt(&*r, r__typ, &tag);
if (tag != -4095) {
Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2);
@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
Texts_Run u = NIL;
Texts_Piece p = NIL;
CHAR tag, version;
int32 hlen;
INT32 hlen;
__DUP(name, name__len, CHAR);
f = Files_Old(name, name__len);
if (f == NIL) {
@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
}
static struct Store__39 {
int8 *ecnt;
INT8 *ecnt;
Texts_FileMsg *msg;
Texts_IdentifyMsg *iden;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Store__39 *lnk;
} *Store__39_s;
static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e);
static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e);
static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e)
static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e)
{
Files_Rider r1;
int32 org, span;
int8 eno;
INT32 org, span;
INT8 eno;
__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;
@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele
Files_WriteLInt(&r1, Files_Rider__typ, e->H);
}
void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T)
void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
Files_Rider r1;
Texts_Run u = NIL, un = NIL;
Texts_Elem e = NIL;
int32 org, pos, delta, hlen, rlen;
int8 ecnt, fcnt;
INT32 org, pos, delta, hlen, rlen;
INT8 ecnt, fcnt;
CHAR ch;
int8 fno;
INT8 fno;
Texts_FileMsg msg;
Texts_IdentifyMsg iden;
CHAR mods[64][32], procs[64][32];
@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
{
Files_File f = NIL;
Files_Rider r;
int16 i, res;
INT16 i, res;
CHAR bak[64];
__DUP(name, name__len, CHAR);
f = Files_New(name, name__len);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Texts__h
#define Texts__h
@ -8,7 +8,7 @@
typedef
struct Texts_BufDesc {
int32 len;
INT32 len;
char _prvt0[4];
} Texts_BufDesc;
@ -30,25 +30,25 @@ typedef
typedef
struct Texts_RunDesc {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[15];
} Texts_RunDesc;
typedef
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *);
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *);
typedef
struct Texts_ElemDesc {
char _prvt0[20];
int32 W, H;
INT32 W, H;
Texts_Handler handle;
char _prvt1[4];
} Texts_ElemDesc;
typedef
struct Texts_FileMsg { /* Texts_ElemMsg */
int16 id;
int32 pos;
INT16 id;
INT32 pos;
Files_Rider r;
} Texts_FileMsg;
@ -69,13 +69,13 @@ typedef
struct Texts_TextDesc *Texts_Text;
typedef
void (*Texts_Notifier)(Texts_Text, int16, int32, int32);
void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32);
typedef
struct Texts_Reader {
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
char _prvt0[32];
} Texts_Reader;
@ -84,22 +84,22 @@ typedef
struct Texts_Scanner { /* Texts_Reader */
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
char _prvt0[32];
CHAR nextCh;
int16 line, class;
int32 i;
INT16 line, class;
INT32 i;
REAL x;
LONGREAL y;
CHAR c;
int8 len;
INT8 len;
CHAR s[64];
} Texts_Scanner;
typedef
struct Texts_TextDesc {
int32 len;
INT32 len;
Texts_Notifier notify;
char _prvt0[12];
} Texts_TextDesc;
@ -108,64 +108,64 @@ typedef
struct Texts_Writer {
Texts_Buffer buf;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
char _prvt0[26];
} Texts_Writer;
import Texts_Elem Texts_new;
import address *Texts_FontDesc__typ;
import address *Texts_RunDesc__typ;
import address *Texts_ElemMsg__typ;
import address *Texts_ElemDesc__typ;
import address *Texts_FileMsg__typ;
import address *Texts_CopyMsg__typ;
import address *Texts_IdentifyMsg__typ;
import address *Texts_BufDesc__typ;
import address *Texts_TextDesc__typ;
import address *Texts_Reader__typ;
import address *Texts_Scanner__typ;
import address *Texts_Writer__typ;
import ADDRESS *Texts_FontDesc__typ;
import ADDRESS *Texts_RunDesc__typ;
import ADDRESS *Texts_ElemMsg__typ;
import ADDRESS *Texts_ElemDesc__typ;
import ADDRESS *Texts_FileMsg__typ;
import ADDRESS *Texts_CopyMsg__typ;
import ADDRESS *Texts_IdentifyMsg__typ;
import ADDRESS *Texts_BufDesc__typ;
import ADDRESS *Texts_TextDesc__typ;
import ADDRESS *Texts_Reader__typ;
import ADDRESS *Texts_Scanner__typ;
import ADDRESS *Texts_Writer__typ;
import void Texts_Append (Texts_Text T, Texts_Buffer B);
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff);
import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
import void Texts_Delete (Texts_Text T, int32 beg, int32 end);
import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
import Texts_Text Texts_ElemBase (Texts_Elem E);
import int32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B);
import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T);
import INT32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);
import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len);
import void Texts_OpenBuf (Texts_Buffer B);
import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos);
import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos);
import void Texts_OpenWriter (Texts_Writer *W, address *W__typ);
import int32 Texts_Pos (Texts_Reader *R, address *R__typ);
import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch);
import void Texts_ReadElem (Texts_Reader *R, address *R__typ);
import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ);
import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos);
import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos);
import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ);
import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch);
import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_Recall (Texts_Buffer *B);
import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B);
import void Texts_Scan (Texts_Scanner *S, address *S__typ);
import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col);
import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt);
import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff);
import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T);
import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch);
import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d);
import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e);
import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x);
import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n);
import void Texts_WriteLn (Texts_Writer *W, address *W__typ);
import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n);
import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x);
import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n);
import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k);
import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x);
import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len);
import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B);
import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ);
import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col);
import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt);
import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff);
import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch);
import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d);
import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e);
import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x);
import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n);
import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ);
import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n);
import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x);
import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n);
import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k);
import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len);
import void *Texts__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Out.h"
@ -14,36 +14,36 @@ export CHAR VT100_CSI[5];
static CHAR VT100_tmpstr[32];
export void VT100_CHA (int16 n);
export void VT100_CNL (int16 n);
export void VT100_CPL (int16 n);
export void VT100_CUB (int16 n);
export void VT100_CUD (int16 n);
export void VT100_CUF (int16 n);
export void VT100_CUP (int16 n, int16 m);
export void VT100_CUU (int16 n);
export void VT100_CHA (INT16 n);
export void VT100_CNL (INT16 n);
export void VT100_CPL (INT16 n);
export void VT100_CUB (INT16 n);
export void VT100_CUD (INT16 n);
export void VT100_CUF (INT16 n);
export void VT100_CUP (INT16 n, INT16 m);
export void VT100_CUU (INT16 n);
export void VT100_DECTCEMh (void);
export void VT100_DECTCEMl (void);
export void VT100_DSR (int16 n);
export void VT100_ED (int16 n);
export void VT100_EL (int16 n);
static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len);
export void VT100_DSR (INT16 n);
export void VT100_ED (INT16 n);
export void VT100_EL (INT16 n);
static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len);
static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len);
export void VT100_HVP (int16 n, int16 m);
export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len);
static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len);
export void VT100_HVP (INT16 n, INT16 m);
export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len);
export void VT100_RCP (void);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end);
export void VT100_SCP (void);
export void VT100_SD (int16 n);
export void VT100_SGR (int16 n);
export void VT100_SGR2 (int16 n, int16 m);
export void VT100_SU (int16 n);
export void VT100_SD (INT16 n);
export void VT100_SGR (INT16 n);
export void VT100_SGR2 (INT16 n, INT16 m);
export void VT100_SU (INT16 n);
export void VT100_SetAttr (CHAR *attr, LONGINT attr__len);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end)
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end)
{
CHAR h;
while (start < end) {
@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end)
}
}
void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len)
void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len)
{
CHAR b[21];
int16 s, e;
int8 maxLength;
INT16 s, e;
INT8 maxLength;
maxLength = 11;
if (int_ == (-2147483647-1)) {
__MOVE("-2147483648", b, 12);
@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[2];
CHAR cmd[7];
@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[2];
CHAR cmd[7];
@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[5], mstr[5];
CHAR cmd[12];
@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
void VT100_CUU (int16 n)
void VT100_CUU (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"A", 2);
}
void VT100_CUD (int16 n)
void VT100_CUD (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"B", 2);
}
void VT100_CUF (int16 n)
void VT100_CUF (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"C", 2);
}
void VT100_CUB (int16 n)
void VT100_CUB (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"D", 2);
}
void VT100_CNL (int16 n)
void VT100_CNL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"E", 2);
}
void VT100_CPL (int16 n)
void VT100_CPL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"F", 2);
}
void VT100_CHA (int16 n)
void VT100_CHA (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"G", 2);
}
void VT100_CUP (int16 n, int16 m)
void VT100_CUP (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"H", 2);
}
void VT100_ED (int16 n)
void VT100_ED (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"J", 2);
}
void VT100_EL (int16 n)
void VT100_EL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"K", 2);
}
void VT100_SU (int16 n)
void VT100_SU (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"S", 2);
}
void VT100_SD (int16 n)
void VT100_SD (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"T", 2);
}
void VT100_HVP (int16 n, int16 m)
void VT100_HVP (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"f", 2);
}
void VT100_SGR (int16 n)
void VT100_SGR (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"m", 2);
}
void VT100_SGR2 (int16 n, int16 m)
void VT100_SGR2 (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"m", 2);
}
void VT100_DSR (int16 n)
void VT100_DSR (INT16 n)
{
VT100_EscSeq(6, (CHAR*)"n", 2);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef VT100__h
#define VT100__h
@ -9,27 +9,27 @@
import CHAR VT100_CSI[5];
import void VT100_CHA (int16 n);
import void VT100_CNL (int16 n);
import void VT100_CPL (int16 n);
import void VT100_CUB (int16 n);
import void VT100_CUD (int16 n);
import void VT100_CUF (int16 n);
import void VT100_CUP (int16 n, int16 m);
import void VT100_CUU (int16 n);
import void VT100_CHA (INT16 n);
import void VT100_CNL (INT16 n);
import void VT100_CPL (INT16 n);
import void VT100_CUB (INT16 n);
import void VT100_CUD (INT16 n);
import void VT100_CUF (INT16 n);
import void VT100_CUP (INT16 n, INT16 m);
import void VT100_CUU (INT16 n);
import void VT100_DECTCEMh (void);
import void VT100_DECTCEMl (void);
import void VT100_DSR (int16 n);
import void VT100_ED (int16 n);
import void VT100_EL (int16 n);
import void VT100_HVP (int16 n, int16 m);
import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len);
import void VT100_DSR (INT16 n);
import void VT100_ED (INT16 n);
import void VT100_EL (INT16 n);
import void VT100_HVP (INT16 n, INT16 m);
import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len);
import void VT100_RCP (void);
import void VT100_SCP (void);
import void VT100_SD (int16 n);
import void VT100_SGR (int16 n);
import void VT100_SGR2 (int16 n, int16 m);
import void VT100_SU (int16 n);
import void VT100_SD (INT16 n);
import void VT100_SGR (INT16 n);
import void VT100_SGR2 (INT16 n, INT16 m);
import void VT100_SU (INT16 n);
import void VT100_SetAttr (CHAR *attr, LONGINT attr__len);
import void *VT100__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len)
{
int16 r, status, exitcode;
INT16 r, status, exitcode;
__DUP(title, title__len, CHAR);
__DUP(cmd, cmd__len, CHAR);
if (__IN(18, OPM_Options, 32)) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -26,7 +26,7 @@ static CHAR Compiler_mname[256];
export void Compiler_Module (BOOLEAN *done);
static void Compiler_PropagateElementaryTypeSizes (void);
export void Compiler_Translate (void);
static void Compiler_Trap (int32 sig);
static void Compiler_Trap (INT32 sig);
void Compiler_Module (BOOLEAN *done)
@ -147,7 +147,7 @@ void Compiler_Translate (void)
}
}
static void Compiler_Trap (int32 sig)
static void Compiler_Trap (INT32 sig)
{
Heap_FINALL();
if (sig == 3) {

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -18,7 +18,7 @@ typedef
struct Files_BufDesc {
Files_File f;
BOOLEAN chg;
int32 org, size;
INT32 org, size;
SYSTEM_BYTE data[4096];
} Files_BufDesc;
@ -33,85 +33,85 @@ typedef
Files_FileName workName, registerName;
BOOLEAN tempFile;
Platform_FileIdentity identity;
int32 fd, len, pos;
INT32 fd, len, pos;
Files_Buffer bufs[4];
int16 swapper, state;
INT16 swapper, state;
Files_File next;
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
Files_Buffer buf;
int32 org, offset;
INT32 org, offset;
} Files_Rider;
static Files_File Files_files;
static int16 Files_tempno;
static INT16 Files_tempno;
static CHAR Files_HOME[1024];
static struct {
LONGINT len[1];
CHAR data[1];
} *Files_SearchPath;
export address *Files_FileDesc__typ;
export address *Files_BufDesc__typ;
export address *Files_Rider__typ;
export ADDRESS *Files_FileDesc__typ;
export ADDRESS *Files_BufDesc__typ;
export ADDRESS *Files_Rider__typ;
export Files_File Files_Base (Files_Rider *r, address *r__typ);
export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
export void Files_Close (Files_File f);
static void Files_CloseOSFile (Files_File f);
static void Files_Create (Files_File f);
export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode);
export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode);
static void Files_Finalize (SYSTEM_PTR o);
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len);
static void Files_Flush (Files_Buffer buf);
export void Files_GetDate (Files_File f, int32 *t, int32 *d);
export void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
export int32 Files_Length (Files_File f);
export INT32 Files_Length (Files_File f);
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
export Files_File Files_New (CHAR *name, LONGINT name__len);
export Files_File Files_Old (CHAR *name, LONGINT name__len);
export int32 Files_Pos (Files_Rider *r, address *r__typ);
export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
export void Files_Purge (Files_File f);
export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_Register (Files_File f);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
export void Files_SetSearchPath (CHAR *path, LONGINT path__len);
export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
#define Files_IdxTrap() __HALT(-1)
#define Files_ToAdr(x) (address)x
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode)
{
__DUP(s, s__len, CHAR);
Out_Ln();
@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len)
{
int16 i, j;
INT16 i, j;
__DUP(dir, dir__len, CHAR);
__DUP(name, name__len, CHAR);
i = 0;
@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len)
{
int32 n, i, j;
INT32 n, i, j;
__DUP(finalName, finalName__len, CHAR);
Files_tempno += 1;
n = Files_tempno;
@ -217,7 +217,7 @@ static void Files_Create (Files_File f)
{
Platform_FileIdentity identity;
BOOLEAN done;
int16 error;
INT16 error;
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
@ -254,7 +254,7 @@ static void Files_Create (Files_File f)
static void Files_Flush (Files_Buffer buf)
{
int16 error;
INT16 error;
Files_File f = NIL;
if (buf->chg) {
f = buf->f;
@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf)
static void Files_CloseOSFile (Files_File f)
{
Files_File prev = NIL;
int16 error;
INT16 error;
if (Files_files == f) {
Files_files = f->next;
} else {
@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f)
void Files_Close (Files_File f)
{
int32 i;
int16 error;
INT32 i;
INT16 error;
if (f->state != 1 || f->registerName[0] != 0x00) {
Files_Create(f);
i = 0;
@ -315,7 +315,7 @@ void Files_Close (Files_File f)
}
}
int32 Files_Length (Files_File f)
INT32 Files_Length (Files_File f)
{
return f->len;
}
@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
return f;
}
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
if (Files_SearchPath == NIL) {
@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
ch = name[0];
@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{
Files_File f = NIL;
int16 i, error;
INT16 i, error;
f = Files_files;
while (f != NIL) {
if (Platform_SameFile(identity, f->identity)) {
@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
Files_File Files_Old (CHAR *name, LONGINT name__len)
{
Files_File f = NIL;
int32 fd;
int16 pos;
INT32 fd;
INT16 pos;
BOOLEAN done;
CHAR dir[256], path[256];
int16 error;
INT16 error;
Platform_FileIdentity identity;
__DUP(name, name__len, CHAR);
if (name[0] != 0x00) {
@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
void Files_Purge (Files_File f)
{
int16 i;
INT16 i;
Platform_FileIdentity identity;
int16 error;
INT16 error;
i = 0;
while (i < 4) {
if (f->bufs[i] != NIL) {
@ -519,25 +519,25 @@ void Files_Purge (Files_File f)
Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity);
}
void Files_GetDate (Files_File f, int32 *t, int32 *d)
void Files_GetDate (Files_File f, INT32 *t, INT32 *d)
{
Platform_FileIdentity identity;
int16 error;
INT16 error;
Files_Create(f);
error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ);
Platform_MTimeAsClock(identity, &*t, &*d);
}
int32 Files_Pos (Files_Rider *r, address *r__typ)
INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).org + (*r).offset;
}
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos)
{
int32 org, offset, i, n;
INT32 org, offset, i, n;
Files_Buffer buf = NIL;
int16 error;
INT16 error;
if (f != NIL) {
if (pos > f->len) {
pos = f->len;
@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
(*r).res = 0;
}
void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
{
int32 offset;
INT32 offset;
Files_Buffer buf = NIL;
buf = (*r).buf;
offset = (*r).offset;
@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
}
}
void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
(*r).eof = 0;
}
Files_File Files_Base (Files_Rider *r, address *r__typ)
Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).buf->f;
}
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x)
{
Files_Buffer buf = NIL;
int32 offset;
INT32 offset;
buf = (*r).buf;
offset = (*r).offset;
if ((*r).org != buf->org || offset >= 4096) {
@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
(*r).res = 0;
}
void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
(*r).res = 0;
}
void Files_Delete (CHAR *name, LONGINT name__len, int16 *res)
void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res)
{
__DUP(name, name__len, CHAR);
*res = Platform_Unlink((void*)name, name__len);
__DEL(name);
}
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res)
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res)
{
int32 fdold, fdnew, n;
int16 error, ignore;
INT32 fdold, fdnew, n;
INT16 error, ignore;
Platform_FileIdentity oldidentity, newidentity;
CHAR buf[4096];
__DUP(old, old__len, CHAR);
@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
void Files_Register (Files_File f)
{
int16 idx, errcode;
INT16 idx, errcode;
Files_File f1 = NIL;
CHAR file[104];
if ((f->state == 1 && f->registerName[0] != 0x00)) {
@ -807,7 +807,7 @@ void Files_Register (Files_File f)
}
}
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res)
{
__DUP(path, path__len, CHAR);
*res = Platform_Chdir((void*)path, path__len);
@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len)
{
int32 i, j;
INT32 i, j;
if (!Platform_LittleEndian) {
i = src__len;
j = 0;
@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
}
}
void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x)
void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x)
{
Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
}
void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x)
void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = (int16)b[0] + __ASHL((int16)b[1], 8);
*x = (INT16)b[0] + __ASHL((INT16)b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x)
{
CHAR b[4];
int32 l;
INT32 l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (uint32)l;
l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (UINT32)l;
}
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x)
void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!(ch == 0x00));
}
void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
BOOLEAN b;
i = 0;
@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!b);
}
void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
int8 s, b;
int64 q;
INT8 s, b;
INT64 q;
s = 0;
q = 0;
Files_Read(&*R, R__typ, (void*)&b);
while (b < 0) {
q += (int64)__ASH(((int16)b + 128), s);
q += (INT64)__ASH(((INT16)b + 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&b);
}
q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
__ASSERT(x__len <= 8, 0);
__MOVE((address)&q, (address)x, x__len);
}
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x)
{
Files_Write(&*R, R__typ, __VAL(CHAR, x));
}
void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x)
{
CHAR b[2];
b[0] = (CHAR)x;
@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x)
{
CHAR b[4];
b[0] = (CHAR)x;
@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x)
{
CHAR b[4];
int32 i;
i = (int32)x;
INT32 i;
i = (INT32)x;
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x)
void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x)
void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
i = 0;
while (x[i] != 0x00) {
i += 1;
@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x)
{
while (x < -64 || x > 63) {
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len)
static void Files_Finalize (SYSTEM_PTR o)
{
Files_File f = NIL;
int32 res;
INT32 res;
f = (Files_File)(address)o;
if (f->fd >= 0) {
Files_CloseOSFile(f);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef Files__h
#define Files__h
@ -11,58 +11,58 @@ typedef
typedef
struct Files_FileDesc {
char _prvt0[216];
int32 fd;
INT32 fd;
char _prvt1[32];
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
char _prvt0[15];
} Files_Rider;
import address *Files_FileDesc__typ;
import address *Files_Rider__typ;
import ADDRESS *Files_FileDesc__typ;
import ADDRESS *Files_Rider__typ;
import Files_File Files_Base (Files_Rider *r, address *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
import void Files_Close (Files_File f);
import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
import void Files_GetDate (Files_File f, int32 *t, int32 *d);
import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
import void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
import int32 Files_Length (Files_File f);
import INT32 Files_Length (Files_File f);
import Files_File Files_New (CHAR *name, LONGINT name__len);
import Files_File Files_Old (CHAR *name, LONGINT name__len);
import int32 Files_Pos (Files_Rider *r, address *r__typ);
import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
import void Files_Purge (Files_File f);
import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_Register (Files_File f);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
import void Files_SetSearchPath (CHAR *path, LONGINT path__len);
import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void *Files__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -40,7 +40,7 @@ typedef
typedef
struct Heap_FinDesc {
Heap_FinNode next;
int32 obj;
INT32 obj;
BOOLEAN marked;
Heap_Finalizer finalize;
} Heap_FinDesc;
@ -55,53 +55,53 @@ typedef
struct Heap_ModuleDesc {
Heap_Module next;
Heap_ModuleName name;
int32 refcnt;
INT32 refcnt;
Heap_Cmd cmds;
int32 types;
INT32 types;
Heap_EnumProc enumPtrs;
int32 reserved1, reserved2;
INT32 reserved1, reserved2;
} Heap_ModuleDesc;
export SYSTEM_PTR Heap_modules;
static int32 Heap_freeList[10];
static int32 Heap_bigBlocks;
export int32 Heap_allocated;
static INT32 Heap_freeList[10];
static INT32 Heap_bigBlocks;
export INT32 Heap_allocated;
static BOOLEAN Heap_firstTry;
static int32 Heap_heap, Heap_heapend;
export int32 Heap_heapsize;
static INT32 Heap_heap, Heap_heapend;
export INT32 Heap_heapsize;
static Heap_FinNode Heap_fin;
static int16 Heap_lockdepth;
static INT16 Heap_lockdepth;
static BOOLEAN Heap_interrupted;
export int16 Heap_FileCount;
export INT16 Heap_FileCount;
export address *Heap_ModuleDesc__typ;
export address *Heap_CmdDesc__typ;
export address *Heap_FinDesc__typ;
export address *Heap__1__typ;
export ADDRESS *Heap_ModuleDesc__typ;
export ADDRESS *Heap_CmdDesc__typ;
export ADDRESS *Heap_FinDesc__typ;
export ADDRESS *Heap__1__typ;
static void Heap_CheckFin (void);
static void Heap_ExtendHeap (int32 blksz);
static void Heap_ExtendHeap (INT32 blksz);
export void Heap_FINALL (void);
static void Heap_Finalize (void);
export void Heap_GC (BOOLEAN markStack);
static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len);
static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len);
export void Heap_INCREF (Heap_Module m);
export void Heap_InitHeap (void);
export void Heap_Lock (void);
static void Heap_Mark (int32 q);
static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len);
static void Heap_Mark (INT32 q);
static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len);
static void Heap_MarkP (SYSTEM_PTR p);
static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (int32 size);
export SYSTEM_PTR Heap_NEWREC (int32 tag);
static int32 Heap_NewChunk (int32 blksz);
static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (INT32 size);
export SYSTEM_PTR Heap_NEWREC (INT32 tag);
static INT32 Heap_NewChunk (INT32 blksz);
export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
export void Heap_REGTYP (Heap_Module m, int32 typ);
export void Heap_REGTYP (Heap_Module m, INT32 typ);
export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
static void Heap_Scan (void);
static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len);
static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len);
export void Heap_Unlock (void);
extern void *Heap__init();
@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
m->cmds = c;
}
void Heap_REGTYP (Heap_Module m, int32 typ)
void Heap_REGTYP (Heap_Module m, INT32 typ)
{
__PUT(typ, m->types, int32);
__PUT(typ, m->types, INT32);
m->types = typ;
}
@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m)
m->refcnt += 1;
}
static int32 Heap_NewChunk (int32 blksz)
static INT32 Heap_NewChunk (INT32 blksz)
{
int32 chnk;
INT32 chnk;
chnk = Heap_OSAllocate(blksz + 12);
if (chnk != 0) {
__PUT(chnk + 4, chnk + (12 + blksz), int32);
__PUT(chnk + 12, chnk + 16, int32);
__PUT(chnk + 16, blksz, int32);
__PUT(chnk + 20, -4, int32);
__PUT(chnk + 24, Heap_bigBlocks, int32);
__PUT(chnk + 4, chnk + (12 + blksz), INT32);
__PUT(chnk + 12, chnk + 16, INT32);
__PUT(chnk + 16, blksz, INT32);
__PUT(chnk + 20, -4, INT32);
__PUT(chnk + 24, Heap_bigBlocks, INT32);
Heap_bigBlocks = chnk + 12;
Heap_heapsize += blksz;
}
return chnk;
}
static void Heap_ExtendHeap (int32 blksz)
static void Heap_ExtendHeap (INT32 blksz)
{
int32 size, chnk, j, next;
INT32 size, chnk, j, next;
if (blksz > 160000) {
size = blksz;
} else {
@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz)
chnk = Heap_NewChunk(size);
if (chnk != 0) {
if (chnk < Heap_heap) {
__PUT(chnk, Heap_heap, int32);
__PUT(chnk, Heap_heap, INT32);
Heap_heap = chnk;
} else {
j = Heap_heap;
__GET(j, next, int32);
__GET(j, next, INT32);
while ((next != 0 && chnk > next)) {
j = next;
__GET(j, next, int32);
__GET(j, next, INT32);
}
__PUT(chnk, next, int32);
__PUT(j, chnk, int32);
__PUT(chnk, next, INT32);
__PUT(j, chnk, INT32);
}
if (next == 0) {
__GET(chnk + 4, Heap_heapend, int32);
__GET(chnk + 4, Heap_heapend, INT32);
}
}
}
SYSTEM_PTR Heap_NEWREC (int32 tag)
SYSTEM_PTR Heap_NEWREC (INT32 tag)
{
int32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new;
Heap_Lock();
__GET(tag, blksz, int32);
__GET(tag, blksz, INT32);
i0 = __ASHR(blksz, 4);
i = i0;
if (i < 9) {
@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
}
}
if (i < 9) {
__GET(adr + 12, next, int32);
__GET(adr + 12, next, INT32);
Heap_freeList[i] = next;
if (i != i0) {
di = i - i0;
restsize = __ASHL(di, 4);
end = adr + restsize;
__PUT(end + 4, blksz, int32);
__PUT(end + 8, -4, int32);
__PUT(end, end + 4, int32);
__PUT(adr + 4, restsize, int32);
__PUT(adr + 12, Heap_freeList[di], int32);
__PUT(end + 4, blksz, INT32);
__PUT(end + 8, -4, INT32);
__PUT(end, end + 4, INT32);
__PUT(adr + 4, restsize, INT32);
__PUT(adr + 12, Heap_freeList[di], INT32);
Heap_freeList[di] = adr;
adr += restsize;
}
@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
return NIL;
}
}
__GET(adr + 4, t, int32);
__GET(adr + 4, t, INT32);
if (t >= blksz) {
break;
}
prev = adr;
__GET(adr + 12, adr, int32);
__GET(adr + 12, adr, INT32);
}
restsize = t - blksz;
end = adr + restsize;
__PUT(end + 4, blksz, int32);
__PUT(end + 8, -4, int32);
__PUT(end, end + 4, int32);
__PUT(end + 4, blksz, INT32);
__PUT(end + 8, -4, INT32);
__PUT(end, end + 4, INT32);
if (restsize > 144) {
__PUT(adr + 4, restsize, int32);
__PUT(adr + 4, restsize, INT32);
} else {
__GET(adr + 12, next, int32);
__GET(adr + 12, next, INT32);
if (prev == 0) {
Heap_bigBlocks = next;
} else {
__PUT(prev + 12, next, int32);
__PUT(prev + 12, next, INT32);
}
if (restsize > 0) {
di = __ASHR(restsize, 4);
__PUT(adr + 4, restsize, int32);
__PUT(adr + 12, Heap_freeList[di], int32);
__PUT(adr + 4, restsize, INT32);
__PUT(adr + 12, Heap_freeList[di], INT32);
Heap_freeList[di] = adr;
}
}
@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag)
i = adr + 16;
end = adr + blksz;
while (i < end) {
__PUT(i, 0, int32);
__PUT(i + 4, 0, int32);
__PUT(i + 8, 0, int32);
__PUT(i + 12, 0, int32);
__PUT(i, 0, INT32);
__PUT(i + 4, 0, INT32);
__PUT(i + 8, 0, INT32);
__PUT(i + 12, 0, INT32);
i += 16;
}
__PUT(adr + 12, 0, int32);
__PUT(adr, tag, int32);
__PUT(adr + 4, 0, int32);
__PUT(adr + 8, 0, int32);
__PUT(adr + 12, 0, INT32);
__PUT(adr, tag, INT32);
__PUT(adr + 4, 0, INT32);
__PUT(adr + 8, 0, INT32);
Heap_allocated += blksz;
Heap_Unlock();
return (SYSTEM_PTR)(address)(adr + 4);
}
SYSTEM_PTR Heap_NEWBLK (int32 size)
SYSTEM_PTR Heap_NEWBLK (INT32 size)
{
int32 blksz, tag;
INT32 blksz, tag;
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 31, 4), 4);
new = Heap_NEWREC((address)&blksz);
tag = ((int32)(address)new + blksz) - 12;
__PUT(tag - 4, 0, int32);
__PUT(tag, blksz, int32);
__PUT(tag + 4, -4, int32);
__PUT((int32)(address)new - 4, tag, int32);
tag = ((INT32)(address)new + blksz) - 12;
__PUT(tag - 4, 0, INT32);
__PUT(tag, blksz, INT32);
__PUT(tag + 4, -4, INT32);
__PUT((INT32)(address)new - 4, tag, INT32);
Heap_Unlock();
return new;
}
static void Heap_Mark (int32 q)
static void Heap_Mark (INT32 q)
{
int32 p, tag, offset, fld, n, tagbits;
INT32 p, tag, offset, fld, n, tagbits;
if (q != 0) {
__GET(q - 4, tagbits, int32);
__GET(q - 4, tagbits, INT32);
if (!__ODD(tagbits)) {
__PUT(q - 4, tagbits + 1, int32);
__PUT(q - 4, tagbits + 1, INT32);
p = 0;
tag = tagbits + 4;
for (;;) {
__GET(tag, offset, int32);
__GET(tag, offset, INT32);
if (offset < 0) {
__PUT(q - 4, (tag + offset) + 1, int32);
__PUT(q - 4, (tag + offset) + 1, INT32);
if (p == 0) {
break;
}
n = q;
q = p;
__GET(q - 4, tag, int32);
__GET(q - 4, tag, INT32);
tag -= 1;
__GET(tag, offset, int32);
__GET(tag, offset, INT32);
fld = q + offset;
__GET(fld, p, int32);
__GET(fld, p, INT32);
__PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR);
} else {
fld = q + offset;
__GET(fld, n, int32);
__GET(fld, n, INT32);
if (n != 0) {
__GET(n - 4, tagbits, int32);
__GET(n - 4, tagbits, INT32);
if (!__ODD(tagbits)) {
__PUT(n - 4, tagbits + 1, int32);
__PUT(q - 4, tag + 1, int32);
__PUT(n - 4, tagbits + 1, INT32);
__PUT(q - 4, tag + 1, INT32);
__PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR);
p = q;
q = n;
@ -379,12 +379,12 @@ static void Heap_Mark (int32 q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((int32)(address)p);
Heap_Mark((INT32)(address)p);
}
static void Heap_Scan (void)
{
int32 chnk, adr, end, start, tag, i, size, freesize;
INT32 chnk, adr, end, start, tag, i, size, freesize;
Heap_bigBlocks = 0;
i = 1;
while (i < 9) {
@ -396,58 +396,58 @@ static void Heap_Scan (void)
chnk = Heap_heap;
while (chnk != 0) {
adr = chnk + 12;
__GET(chnk + 4, end, int32);
__GET(chnk + 4, end, INT32);
while (adr < end) {
__GET(adr, tag, int32);
__GET(adr, tag, INT32);
if (__ODD(tag)) {
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 4, int32);
__PUT(start + 4, freesize, int32);
__PUT(start + 8, -4, int32);
__PUT(start, start + 4, INT32);
__PUT(start + 4, freesize, INT32);
__PUT(start + 8, -4, INT32);
i = __ASHR(freesize, 4);
freesize = 0;
if (i < 9) {
__PUT(start + 12, Heap_freeList[i], int32);
__PUT(start + 12, Heap_freeList[i], INT32);
Heap_freeList[i] = start;
} else {
__PUT(start + 12, Heap_bigBlocks, int32);
__PUT(start + 12, Heap_bigBlocks, INT32);
Heap_bigBlocks = start;
}
}
tag -= 1;
__PUT(adr, tag, int32);
__GET(tag, size, int32);
__PUT(adr, tag, INT32);
__GET(tag, size, INT32);
Heap_allocated += size;
adr += size;
} else {
__GET(tag, size, int32);
__GET(tag, size, INT32);
freesize += size;
adr += size;
}
}
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 4, int32);
__PUT(start + 4, freesize, int32);
__PUT(start + 8, -4, int32);
__PUT(start, start + 4, INT32);
__PUT(start + 4, freesize, INT32);
__PUT(start + 8, -4, INT32);
i = __ASHR(freesize, 4);
freesize = 0;
if (i < 9) {
__PUT(start + 12, Heap_freeList[i], int32);
__PUT(start + 12, Heap_freeList[i], INT32);
Heap_freeList[i] = start;
} else {
__PUT(start + 12, Heap_bigBlocks, int32);
__PUT(start + 12, Heap_bigBlocks, INT32);
Heap_bigBlocks = start;
}
}
__GET(chnk, chnk, int32);
__GET(chnk, chnk, INT32);
}
}
static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len)
static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len)
{
int32 i, j, x;
INT32 i, j, x;
j = l;
x = a[j];
for (;;) {
@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len)
a[i] = x;
}
static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len)
static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len)
{
int32 l, r, x;
INT32 l, r, x;
l = __ASHR(n, 1);
r = n - 1;
while (l > 0) {
@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len)
}
}
static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len)
static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len)
{
int32 chnk, adr, tag, next, lim, lim1, i, ptr, size;
INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size;
chnk = Heap_heap;
i = 0;
lim = cand[n - 1];
while ((chnk != 0 && chnk < lim)) {
adr = chnk + 12;
__GET(chnk + 4, lim1, int32);
__GET(chnk + 4, lim1, INT32);
if (lim < lim1) {
lim1 = lim;
}
while (adr < lim1) {
__GET(adr, tag, int32);
__GET(adr, tag, INT32);
if (__ODD(tag)) {
__GET(tag - 1, size, int32);
__GET(tag - 1, size, INT32);
adr += size;
} else {
__GET(tag, size, int32);
__GET(tag, size, INT32);
ptr = adr + 4;
while (cand[i] < ptr) {
i += 1;
@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len)
adr = next;
}
}
__GET(chnk, chnk, int32);
__GET(chnk, chnk, INT32);
}
}
static void Heap_CheckFin (void)
{
Heap_FinNode n;
int32 tag;
INT32 tag;
n = Heap_fin;
while (n != NIL) {
__GET(n->obj - 4, tag, int32);
__GET(n->obj - 4, tag, INT32);
if (!__ODD(tag)) {
n->marked = 0;
Heap_Mark(n->obj);
@ -571,10 +571,10 @@ void Heap_FINALL (void)
}
}
static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len)
{
SYSTEM_PTR frame;
int32 inc, nofcand, sp, p, stack0;
INT32 inc, nofcand, sp, p, stack0;
struct Heap__1 align;
if (n > 0) {
Heap_MarkStack(n - 1, cand, cand__len);
@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
inc = -inc;
}
while (sp != stack0) {
__GET(sp, p, int32);
__GET(sp, p, INT32);
if ((p > Heap_heap && p < Heap_heapend)) {
if (nofcand == cand__len) {
Heap_HeapSort(nofcand, (void*)cand, cand__len);
@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len)
void Heap_GC (BOOLEAN markStack)
{
Heap_Module m;
int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
int32 cand[10000];
INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
INT32 cand[10000];
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
Heap_Lock();
m = (Heap_Module)(address)Heap_modules;
@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (int32)(address)obj;
f->obj = (INT32)(address)obj;
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;
@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
void Heap_InitHeap (void)
{
Heap_heap = Heap_NewChunk(128000);
__GET(Heap_heap + 4, Heap_heapend, int32);
__PUT(Heap_heap, 0, int32);
__GET(Heap_heap + 4, Heap_heapend, INT32);
__PUT(Heap_heap, 0, INT32);
Heap_allocated = 0;
Heap_firstTry = 1;
Heap_freeList[9] = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#ifndef Heap__h
#define Heap__h
@ -22,7 +22,7 @@ typedef
typedef
struct Heap_ModuleDesc {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[44];
} Heap_ModuleDesc;
@ -31,21 +31,21 @@ typedef
import SYSTEM_PTR Heap_modules;
import int32 Heap_allocated, Heap_heapsize;
import int16 Heap_FileCount;
import INT32 Heap_allocated, Heap_heapsize;
import INT16 Heap_FileCount;
import address *Heap_ModuleDesc__typ;
import ADDRESS *Heap_ModuleDesc__typ;
import void Heap_FINALL (void);
import void Heap_GC (BOOLEAN markStack);
import void Heap_INCREF (Heap_Module m);
import void Heap_InitHeap (void);
import void Heap_Lock (void);
import SYSTEM_PTR Heap_NEWBLK (int32 size);
import SYSTEM_PTR Heap_NEWREC (int32 tag);
import SYSTEM_PTR Heap_NEWBLK (INT32 size);
import SYSTEM_PTR Heap_NEWREC (INT32 tag);
import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
import void Heap_REGTYP (Heap_Module m, int32 typ);
import void Heap_REGTYP (Heap_Module m, INT32 typ);
import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
import void Heap_Unlock (void);
import void *Heap__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -31,20 +31,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
int32 reserved1, reserved2;
INT32 types;
void (*enumPtrs)(void(*)(INT32));
INT32 reserved1, reserved2;
} Modules_ModuleDesc;
export int16 Modules_res;
export INT16 Modules_res;
export CHAR Modules_resMsg[256];
export Modules_ModuleName Modules_imported, Modules_importing;
export address *Modules_ModuleDesc__typ;
export address *Modules_CmdDesc__typ;
export ADDRESS *Modules_ModuleDesc__typ;
export ADDRESS *Modules_CmdDesc__typ;
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len);
export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
{
int16 i, j;
INT16 i, j;
__DUP(b, b__len, CHAR);
i = 0;
while (a[__X(i, a__len)] != 0x00) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Modules__h
#define Modules__h
@ -28,20 +28,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
INT32 types;
void (*enumPtrs)(void(*)(INT32));
char _prvt0[8];
} Modules_ModuleDesc;
import int16 Modules_res;
import INT16 Modules_res;
import CHAR Modules_resMsg[256];
import Modules_ModuleName Modules_imported, Modules_importing;
import address *Modules_ModuleDesc__typ;
import address *Modules_CmdDesc__typ;
import ADDRESS *Modules_ModuleDesc__typ;
import ADDRESS *Modules_CmdDesc__typ;
import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -11,13 +11,13 @@
#include "OPT.h"
static int16 OPB_exp;
static int64 OPB_maxExp;
static INT16 OPB_exp;
static INT64 OPB_maxExp;
export void OPB_Assign (OPT_Node *x, OPT_Node y);
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static int16 OPB_BoolToInt (BOOLEAN b);
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static INT16 OPB_BoolToInt (BOOLEAN b);
export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
static void OPB_CharToString (OPT_Node n);
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode);
@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo);
export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
static void OPB_CheckProc (OPT_Struct x, OPT_Object y);
static void OPB_CheckPtr (OPT_Node x, OPT_Node y);
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x);
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x);
static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp);
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
static void OPB_Convert (OPT_Node *x, OPT_Struct typ);
export void OPB_DeRef (OPT_Node *x);
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar);
@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y);
export void OPB_In (OPT_Node *x, OPT_Node y);
export void OPB_Index (OPT_Node *x, OPT_Node y);
export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
static BOOLEAN OPB_IntToBool (int64 i);
static BOOLEAN OPB_IntToBool (INT64 i);
export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
export void OPB_MOp (int8 op, OPT_Node *x);
export void OPB_MOp (INT8 op, OPT_Node *x);
export OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
export OPT_Node OPB_NewIntConst (int64 intval);
export OPT_Node OPB_NewIntConst (INT64 intval);
export OPT_Node OPB_NewLeaf (OPT_Object obj);
export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
export OPT_Node OPB_NewString (OPS_String str, int64 len);
export OPT_Node OPB_NewString (OPS_String str, INT64 len);
export OPT_Node OPB_Nil (void);
static BOOLEAN OPB_NotVar (OPT_Node x);
export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
export void OPB_OptIf (OPT_Node *x);
export void OPB_Param (OPT_Node ap, OPT_Object fp);
export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x);
static void OPB_SetIntType (OPT_Node node);
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
static void OPB_SetSetType (OPT_Node node);
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
export void OPB_StaticLink (int8 dlev);
export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
export void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
export void OPB_StaticLink (INT8 dlev);
export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
static void OPB_err (int16 n);
static int64 OPB_log (int64 x);
static void OPB_err (INT16 n);
static INT64 OPB_log (INT64 x);
static void OPB_err (int16 n)
static void OPB_err (INT16 n)
{
OPM_err(n);
}
@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
return node;
}
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
*last = y;
}
static int16 OPB_BoolToInt (BOOLEAN b)
static INT16 OPB_BoolToInt (BOOLEAN b)
{
if (b) {
return 1;
@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b)
__RETCHK;
}
static BOOLEAN OPB_IntToBool (int64 i)
static BOOLEAN OPB_IntToBool (INT64 i)
{
return i != 0;
}
@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node)
static void OPB_SetSetType (OPT_Node node)
{
int32 i32;
__GET((address)&node->conval->setval + 4, i32, int32);
INT32 i32;
__GET((address)&node->conval->setval + 4, i32, INT32);
if (i32 == 0) {
node->typ = OPT_set32typ;
} else {
@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node)
}
}
OPT_Node OPB_NewIntConst (int64 intval)
OPT_Node OPB_NewIntConst (INT64 intval)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
return x;
}
OPT_Node OPB_NewString (OPS_String str, int64 len)
OPT_Node OPB_NewString (OPS_String str, INT64 len)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n)
n->obj = NIL;
}
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x)
void OPB_Index (OPT_Node *x, OPT_Node y)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
f = y->typ->form;
if ((*x)->class >= 7) {
@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
}
if ((*x)->typ->comp == 2) {
typ = (*x)->typ->BaseTyp;
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) {
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) {
OPB_err(81);
}
} else if ((*x)->typ->comp == 3) {
@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
void OPB_In (OPT_Node *x, OPT_Node y)
{
int16 f;
int64 k;
INT16 f;
INT64 k;
f = (*x)->typ->form;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if ((f == 4 && y->typ->form == 7)) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) {
if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64));
@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
(*x)->typ = OPT_booltyp;
}
static int64 OPB_log (int64 x)
static INT64 OPB_log (INT64 x)
{
OPB_exp = 0;
if (x > 0) {
@ -478,7 +478,7 @@ static int64 OPB_log (int64 x)
return x;
}
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x)
{
LONGREAL min, max, r;
if (f == 5) {
@ -502,9 +502,9 @@ static struct MOp__28 {
struct MOp__28 *lnk;
} *MOp__28_s;
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z)
{
OPT_Node node = NIL;
node = OPT_NewNode(11);
@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
return node;
}
void OPB_MOp (int8 op, OPT_Node *x)
void OPB_MOp (INT8 op, OPT_Node *x)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node z = NIL;
struct MOp__28 _s;
@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int16)__CAP((CHAR)z->conval->intval);
z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
static void OPB_CheckPtr (OPT_Node x, OPT_Node y)
{
int16 g;
INT16 g;
OPT_Struct p = NIL, q = NIL, t = NIL;
g = y->typ->form;
if (g == 11) {
@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y)
static struct ConstOp__13 {
OPT_Node *x;
int16 *f;
INT16 *f;
OPT_Const *xval, *yval;
struct ConstOp__13 *lnk;
} *ConstOp__13_s;
static int16 ConstCmp__14 (void);
static INT16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void)
static INT16 ConstCmp__14 (void)
{
int16 res;
INT16 res;
switch (*ConstOp__13_s->f) {
case 0:
res = 9;
@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void)
return res;
}
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Const xval = NIL, yval = NIL;
int64 xv, yv;
INT64 xv, yv;
BOOLEAN temp;
struct ConstOp__13 _s;
_s.x = &x;
@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
{
OPT_Node node = NIL;
int16 f, g;
int64 k;
INT16 f, g;
INT64 k;
LONGREAL r;
f = (*x)->typ->form;
g = typ->form;
@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
OPB_err(203);
r = (LONGREAL)1;
}
(*x)->conval->intval = (int32)__ENTIER(r);
(*x)->conval->intval = (INT32)__ENTIER(r);
OPB_SetIntType(*x);
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
}
static struct Op__38 {
int16 *f, *g;
INT16 *f, *g;
struct Op__38 *lnk;
} *Op__38_s;
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y);
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(12);
@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
return ok;
}
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Node t = NIL, z = NIL;
OPT_Struct typ = NIL;
BOOLEAN do_;
int64 val;
INT64 val;
struct Op__38 _s;
_s.f = &f;
_s.g = &g;
@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_SetRange (OPT_Node *x, OPT_Node y)
{
int64 k, l;
INT64 k, l;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
void OPB_SetElem (OPT_Node *x)
{
int64 k;
INT64 k;
if ((*x)->class == 8 || (*x)->class == 9) {
OPB_err(126);
} else if ((*x)->typ->form != 4) {
@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{
OPT_Struct y = NIL;
int16 f, g;
INT16 f, g;
OPT_Struct p = NIL, q = NIL;
y = ynode->typ;
f = x->form;
@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo)
{
}
void OPB_StPar0 (OPT_Node *par0, int16 fctno)
void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node x = NIL;
x = *par0;
@ -1983,9 +1983,9 @@ static struct StPar1__53 {
struct StPar1__53 *lnk;
} *StPar1__53_s;
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
return node;
}
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
{
int16 f, L;
INT16 f, L;
OPT_Struct typ = NIL;
OPT_Node p = NIL, t = NIL;
struct StPar1__53 _s;
@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (f == 4) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) {
OPB_err(202);
}
p = NewOp__54(19, fctno, p, x);
@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(208);
p->conval->intval = 1;
} else if (x->conval->intval >= 0) {
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval);
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval);
} else {
OPB_err(208);
p->conval->intval = 1;
@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
StPar1__53_s = _s.lnk;
}
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
{
OPT_Node node = NIL;
int16 f;
INT16 f;
OPT_Node p = NIL;
p = *par0;
f = x->typ->form;
@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
*par0 = p;
}
void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
{
int16 dim;
INT16 dim;
OPT_Node x = NIL, p = NIL;
p = *par0;
if (fctno <= 19) {
@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar)
{
int16 f;
INT16 f;
f = atyp->comp;
ftyp = ftyp->BaseTyp;
atyp = atyp->BaseTyp;
@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
}
}
void OPB_StaticLink (int8 dlev)
void OPB_StaticLink (INT8 dlev)
{
OPT_Object scope = NIL;
scope = OPT_topScope;
@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp)
{
OPT_Struct typ = NIL;
OPT_Node p = NIL;
int8 lev;
INT8 lev;
if ((*x)->class == 9) {
typ = (*x)->typ;
lev = (*x)->obj->mnolev;
@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc)
void OPB_Assign (OPT_Node *x, OPT_Node y)
{
OPT_Node z = NIL;
int8 subcl;
INT8 subcl;
if ((*x)->class >= 7) {
OPB_err(56);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPB__h
#define OPB__h
@ -13,7 +13,7 @@
import void OPB_Assign (OPT_Node *x, OPT_Node y);
import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
import void OPB_DeRef (OPT_Node *x);
import OPT_Node OPB_EmptySet (void);
import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc);
@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y);
import void OPB_Index (OPT_Node *x, OPT_Node y);
import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
import void OPB_MOp (int8 op, OPT_Node *x);
import void OPB_MOp (INT8 op, OPT_Node *x);
import OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
import OPT_Node OPB_NewIntConst (int64 intval);
import OPT_Node OPB_NewIntConst (INT64 intval);
import OPT_Node OPB_NewLeaf (OPT_Object obj);
import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
import OPT_Node OPB_NewString (OPS_String str, int64 len);
import OPT_Node OPB_NewString (OPS_String str, INT64 len);
import OPT_Node OPB_Nil (void);
import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
import void OPB_OptIf (OPT_Node *x);
import void OPB_Param (OPT_Node ap, OPT_Object fp);
import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
import void OPB_Return (OPT_Node *x, OPT_Object proc);
import void OPB_SetElem (OPT_Node *x);
import void OPB_SetRange (OPT_Node *x, OPT_Node y);
import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
import void OPB_StPar0 (OPT_Node *par0, int16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
import void OPB_StaticLink (int8 dlev);
import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
import void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
import void OPB_StaticLink (INT8 dlev);
import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
import void *OPB__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -11,9 +11,9 @@
#include "OPT.h"
static int16 OPC_indentLevel;
static int8 OPC_hashtab[105];
static CHAR OPC_keytab[50][9];
static INT16 OPC_indentLevel;
static INT8 OPC_hashtab[105];
static CHAR OPC_keytab[60][9];
static BOOLEAN OPC_GlbPtrs;
static CHAR OPC_BodyNameExt[13];
@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames);
export OPT_Object OPC_BaseTProc (OPT_Object obj);
export void OPC_BegBlk (void);
export void OPC_BegStat (void);
static void OPC_CProcDefs (OPT_Object obj, int16 vis);
export void OPC_Case (int64 caseVal, int16 form);
static void OPC_CharacterLiteral (int64 c);
export void OPC_Cmp (int16 rel);
static void OPC_CProcDefs (OPT_Object obj, INT16 vis);
export void OPC_Case (INT64 caseVal, INT16 form);
static void OPC_CharacterLiteral (INT64 c);
export void OPC_Cmp (INT16 rel);
export void OPC_CompleteIdent (OPT_Object obj);
export void OPC_Constant (OPT_Const con, int16 form);
export void OPC_Constant (OPT_Const con, INT16 form);
static void OPC_DeclareBase (OPT_Object dcl);
static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef);
static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro);
@ -45,45 +45,45 @@ export void OPC_EnterBody (void);
export void OPC_EnterProc (OPT_Object proc);
export void OPC_ExitBody (void);
export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign);
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign);
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign);
export void OPC_GenBdy (OPT_Node n);
static void OPC_GenDynTypes (OPT_Node n, int16 vis);
static void OPC_GenDynTypes (OPT_Node n, INT16 vis);
export void OPC_GenEnumPtrs (OPT_Object var);
export void OPC_GenHdr (OPT_Node n);
export void OPC_GenHdrIncludes (void);
static void OPC_GenHeaderMsg (void);
export void OPC_Halt (int32 n);
export void OPC_Halt (INT32 n);
export void OPC_Ident (OPT_Object obj);
static void OPC_IdentList (OPT_Object obj, int16 vis);
static void OPC_IdentList (OPT_Object obj, INT16 vis);
static void OPC_Include (CHAR *name, LONGINT name__len);
static void OPC_IncludeImports (OPT_Object obj, int16 vis);
static void OPC_IncludeImports (OPT_Object obj, INT16 vis);
export void OPC_Increment (BOOLEAN decrement);
export void OPC_Indent (int16 count);
export void OPC_Indent (INT16 count);
export void OPC_Init (void);
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 (int64 n, int32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
export void OPC_IntLiteral (INT64 n, INT32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName);
static int16 OPC_Length (CHAR *s, LONGINT s__len);
static INT16 OPC_Length (CHAR *s, LONGINT s__len);
export BOOLEAN OPC_NeedsRetval (OPT_Object proc);
export int32 OPC_NofPtrs (OPT_Struct typ);
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
export INT32 OPC_NofPtrs (OPT_Struct typ);
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len);
static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define);
static void OPC_ProcPredefs (OPT_Object obj, int8 vis);
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis);
static void OPC_PutBase (OPT_Struct typ);
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt);
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt);
static void OPC_RegCmds (OPT_Object obj);
export void OPC_SetInclude (BOOLEAN exclude);
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause);
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l);
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l);
export void OPC_TDescDecl (OPT_Struct typ);
export void OPC_TypeDefs (OPT_Object obj, int16 vis);
export void OPC_TypeDefs (OPT_Object obj, INT16 vis);
export void OPC_TypeOf (OPT_Object ap);
static BOOLEAN OPC_Undefined (OPT_Object obj);
@ -94,14 +94,14 @@ void OPC_Init (void)
__MOVE("__init(void)", OPC_BodyNameExt, 13);
}
void OPC_Indent (int16 count)
void OPC_Indent (INT16 count)
{
OPC_indentLevel += count;
}
void OPC_BegStat (void)
{
int16 i;
INT16 i;
i = OPC_indentLevel;
while (i > 0) {
OPM_Write(0x09);
@ -137,10 +137,10 @@ void OPC_EndBlk0 (void)
OPM_Write('}');
}
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x)
{
CHAR ch;
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
ch = s[0];
i = 0;
@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
__DEL(s);
}
static int16 OPC_Length (CHAR *s, LONGINT s__len)
static INT16 OPC_Length (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len)
return i;
}
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{
int16 i, h;
INT16 i, h;
i = 0;
h = 0;
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
h = 3 * h + (int16)s[__X(i, s__len)];
h = 3 * h + (INT16)s[__X(i, s__len)];
i += 1;
}
return (int)__MOD(h, 105);
@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
void OPC_Ident (OPT_Object obj)
{
int16 mode, level, h;
INT16 mode, level, h;
mode = obj->mode;
level = obj->mnolev;
if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) {
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)], 50)], obj->name) == 0) {
if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) {
OPM_Write('_');
}
}
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
if (obj->typ == OPT_adrtyp) {
OPM_WriteString((CHAR*)"address", 8);
OPM_WriteString((CHAR*)"ADDRESS", 8);
} else {
if (obj->typ->form == 4) {
OPM_WriteString((CHAR*)"int", 4);
OPM_WriteString((CHAR*)"INT", 4);
} else {
OPM_WriteString((CHAR*)"uint", 5);
OPM_WriteString((CHAR*)"UINT", 5);
}
OPM_WriteInt(__ASHL(obj->typ->size, 3));
}
@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj)
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause)
{
int16 pointers;
INT16 pointers;
*openClause = 0;
if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) {
if (__IN(typ->comp, 0x0c, 32)) {
@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
{
OPT_Struct typ = NIL;
BOOLEAN varPar, openClause;
int16 form, comp;
INT16 form, comp;
typ = dcl->typ;
varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef;
OPC_Stars(typ, &openClause);
@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl)
{
OPT_Struct typ = NIL, prev = NIL;
OPT_Object obj = NIL;
int16 nofdims;
int32 off, n, dummy;
INT16 nofdims;
INT32 off, n, dummy;
typ = dcl->typ;
prev = typ;
while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) {
@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
}
}
int32 OPC_NofPtrs (OPT_Struct typ)
INT32 OPC_NofPtrs (OPT_Struct typ)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n;
INT32 n;
if ((typ->form == 11 && typ->sysflag == 0)) {
return 1;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ)
__RETCHK;
}
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt)
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n, i;
INT32 n, i;
if ((typ->form == 11 && typ->sysflag == 0)) {
OPM_WriteInt(adr);
OPM_WriteString((CHAR*)", ", 3);
@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ)
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName)
{
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (showParamName) {
OPC_Ident(par);
OPM_WriteString((CHAR*)"__len", 6);
@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj)
{
OPT_Struct typ = NIL, base = NIL;
int32 mno;
INT32 mno;
typ = obj->link->typ;
if (typ->form == 11) {
typ = typ->BaseTyp;
@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{
int16 i;
INT16 i;
__DUP(y, y__len, CHAR);
i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
return y[__X(i, y__len)] == 0x00;
}
static void OPC_CProcDefs (OPT_Object obj, int16 vis)
static void OPC_CProcDefs (OPT_Object obj, INT16 vis)
{
int16 i;
INT16 i;
OPT_ConstExt ext = NIL;
int16 _for__7;
INT16 _for__7;
if (obj != NIL) {
OPC_CProcDefs(obj->left, vis);
if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) {
if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) {
ext = obj->conval->ext;
i = 1;
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
OPC_DeclareParams(obj->link, 1);
OPM_Write(0x09);
}
_for__7 = (int16)(*obj->conval->ext)[0];
_for__7 = (INT16)(*obj->conval->ext)[0];
i = i;
while (i <= _for__7) {
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
}
}
void OPC_TypeDefs (OPT_Object obj, int16 vis)
void OPC_TypeDefs (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_TypeDefs(obj->left, vis);
@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n)
void OPC_TDescDecl (OPT_Struct typ)
{
int32 nofptrs;
INT32 nofptrs;
OPT_Object o = NIL;
OPC_BegStat();
OPM_WriteString((CHAR*)"__TDESC(", 9);
@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ)
}
}
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign)
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign)
{
int32 adr;
INT32 adr;
adr = off;
OPT_Align(&adr, align);
if ((*curAlign < align && gap - (adr - off) >= align)) {
@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
OPC_BegStat();
switch (align) {
case 2:
OPM_WriteString((CHAR*)"int16", 6);
OPM_WriteString((CHAR*)"INT16", 6);
break;
case 4:
OPM_WriteString((CHAR*)"int32", 6);
OPM_WriteString((CHAR*)"INT32", 6);
break;
case 8:
OPM_WriteString((CHAR*)"int64", 6);
OPM_WriteString((CHAR*)"INT64", 6);
break;
default:
OPM_LogWLn();
@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
}
}
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign)
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign)
{
OPT_Object fld = NIL;
OPT_Struct base = NIL;
int32 gap, adr, align, fldAlign;
INT32 gap, adr, align, fldAlign;
fld = typ->link;
align = __MASK(typ->align, -65536);
if (typ->BaseTyp != NIL) {
@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i
}
}
static void OPC_IdentList (OPT_Object obj, int16 vis)
static void OPC_IdentList (OPT_Object obj, INT16 vis)
{
OPT_Struct base = NIL;
BOOLEAN first;
int16 lastvis;
INT16 lastvis;
base = NIL;
first = 1;
while ((obj != NIL && obj->mode != 13)) {
if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
if (obj->typ != base || (int16)obj->vis != lastvis) {
if (obj->typ != base || (INT16)obj->vis != lastvis) {
if (!first) {
OPC_EndStat();
}
@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis)
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPC_EndStat();
OPC_BegStat();
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
base = NIL;
@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames)
OPM_WriteString((CHAR*)", LONGINT ", 11);
OPC_LenList(obj, 1, showParamNames);
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPM_WriteString((CHAR*)", address *", 12);
OPM_WriteString((CHAR*)", ADDRESS *", 12);
if (showParamNames) {
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
OPM_WriteLn();
}
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis)
{
if (obj != NIL) {
OPC_ProcPredefs(obj->left, vis);
@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len)
__DEL(name);
}
static void OPC_IncludeImports (OPT_Object obj, int16 vis)
static void OPC_IncludeImports (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_IncludeImports(obj->left, vis);
if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
}
OPC_IncludeImports(obj->right, vis);
}
}
static void OPC_GenDynTypes (OPT_Node n, int16 vis)
static void OPC_GenDynTypes (OPT_Node n, INT16 vis)
{
OPT_Struct typ = NIL;
while ((n != NIL && n->class == 14)) {
@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis)
} else {
OPM_WriteString((CHAR*)"export ", 8);
}
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Andent(typ);
OPM_WriteString((CHAR*)"__typ", 6);
OPC_EndStat();
@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void)
{
int16 i;
INT16 i;
OPM_WriteString((CHAR*)"/* ", 4);
OPM_WriteString((CHAR*)"voc", 4);
OPM_Write(' ');
@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n)
OPM_currFile = 1;
OPC_GenHeaderMsg();
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
OPM_WriteString((CHAR*)"#define SHORTINT INT", 21);
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
OPM_WriteString((CHAR*)"#define INTEGER INT", 21);
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
OPM_WriteString((CHAR*)"#define LONGINT INT", 21);
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SET uint", 22);
OPM_WriteString((CHAR*)"#define SET UINT", 22);
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
OPM_WriteLn();
OPM_WriteLn();
@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj)
void OPC_GenEnumPtrs (OPT_Object var)
{
OPT_Struct typ = NIL;
int32 n;
INT32 n;
OPC_GlbPtrs = 0;
while (var != NIL) {
typ = var->typ;
@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc)
{
OPT_Object var = NIL, scope = NIL;
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (proc->vis != 1) {
OPM_WriteString((CHAR*)"static ", 8);
}
@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet)
void OPC_CompleteIdent (OPT_Object obj)
{
int16 comp, level;
INT16 comp, level;
level = obj->mnolev;
if (obj->adr == 1) {
if (obj->typ->comp == 4) {
@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj)
void OPC_TypeOf (OPT_Object ap)
{
int16 i;
INT16 i;
__ASSERT(ap->typ->comp == 4, 0);
if (ap->mode == 2) {
if ((int16)ap->mnolev != OPM_level) {
if ((INT16)ap->mnolev != OPM_level) {
OPM_WriteStringVar((void*)ap->scope->name, 256);
OPM_WriteString((CHAR*)"_s->", 5);
OPC_Ident(ap);
@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap)
}
}
void OPC_Cmp (int16 rel)
void OPC_Cmp (INT16 rel)
{
switch (rel) {
case 9:
@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel)
}
}
static void OPC_CharacterLiteral (int64 c)
static void OPC_CharacterLiteral (INT64 c)
{
if (c < 32 || c > 126) {
OPM_WriteString((CHAR*)"0x", 3);
@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c)
}
}
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l)
{
int32 i;
int16 c;
INT32 i;
INT16 c;
__DUP(s, s__len, CHAR);
OPM_Write('"');
i = 0;
while (i < l) {
c = (int16)s[__X(i, s__len)];
c = (INT16)s[__X(i, s__len)];
if (c < 32 || c > 126) {
OPM_Write('\\');
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
__DEL(s);
}
void OPC_Case (int64 caseVal, int16 form)
void OPC_Case (INT64 caseVal, INT16 form)
{
CHAR ch;
OPM_WriteString((CHAR*)"case ", 6);
@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement)
}
}
void OPC_Halt (int32 n)
void OPC_Halt (INT32 n)
{
OPC_Str1((CHAR*)"__HALT(#)", 10, n);
}
void OPC_IntLiteral (int64 n, int32 size)
void OPC_IntLiteral (INT64 n, INT32 size)
{
if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) {
OPM_WriteString((CHAR*)"((int", 6);
OPM_WriteString((CHAR*)"((INT", 6);
OPM_WriteInt(__ASHL(size, 3));
OPM_WriteString((CHAR*)")(", 3);
OPM_WriteInt(n);
@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size)
}
}
void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim)
{
if (array->comp == 3) {
OPC_CompleteIdent(obj);
@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
}
}
void OPC_Constant (OPT_Const con, int16 form)
void OPC_Constant (OPT_Const con, INT16 form)
{
int16 i;
uint64 s;
int64 hex;
INT16 i;
UINT64 s;
INT64 hex;
BOOLEAN skipLeading;
switch (form) {
case 1:
@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form)
}
static struct InitKeywords__46 {
int8 *n;
INT8 *n;
struct InitKeywords__46 *lnk;
} *InitKeywords__46_s;
@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len);
static void Enter__47 (CHAR *s, LONGINT s__len)
{
int16 h;
INT16 h;
__DUP(s, s__len, CHAR);
h = OPC_PerfectHash((void*)s, s__len);
OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n;
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9);
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9);
*InitKeywords__46_s->n += 1;
__DEL(s);
}
static void OPC_InitKeywords (void)
{
int8 n, i;
INT8 n, i;
struct InitKeywords__46 _s;
_s.n = &n;
_s.lnk = InitKeywords__46_s;
@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void)
OPC_hashtab[__X(i, 105)] = -1;
i += 1;
}
Enter__47((CHAR*)"ADDRESS", 8);
Enter__47((CHAR*)"INT16", 6);
Enter__47((CHAR*)"INT32", 6);
Enter__47((CHAR*)"INT64", 6);
Enter__47((CHAR*)"INT8", 5);
Enter__47((CHAR*)"UINT16", 7);
Enter__47((CHAR*)"UINT32", 7);
Enter__47((CHAR*)"UINT64", 7);
Enter__47((CHAR*)"UINT8", 6);
Enter__47((CHAR*)"address", 8);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"asm", 4);
Enter__47((CHAR*)"auto", 5);
Enter__47((CHAR*)"break", 6);
@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"if", 3);
Enter__47((CHAR*)"import", 7);
Enter__47((CHAR*)"int", 4);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"long", 5);
Enter__47((CHAR*)"register", 9);
Enter__47((CHAR*)"return", 7);
@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"struct", 7);
Enter__47((CHAR*)"switch", 7);
Enter__47((CHAR*)"typedef", 8);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"union", 6);
Enter__47((CHAR*)"unsigned", 9);
Enter__47((CHAR*)"void", 5);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPC__h
#define OPC__h
@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ);
import OPT_Object OPC_BaseTProc (OPT_Object obj);
import void OPC_BegBlk (void);
import void OPC_BegStat (void);
import void OPC_Case (int64 caseVal, int16 form);
import void OPC_Cmp (int16 rel);
import void OPC_Case (INT64 caseVal, INT16 form);
import void OPC_Cmp (INT16 rel);
import void OPC_CompleteIdent (OPT_Object obj);
import void OPC_Constant (OPT_Const con, int16 form);
import void OPC_Constant (OPT_Const con, INT16 form);
import void OPC_DefineInter (OPT_Object proc);
import void OPC_EndBlk (void);
import void OPC_EndBlk0 (void);
@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n);
import void OPC_GenEnumPtrs (OPT_Object var);
import void OPC_GenHdr (OPT_Node n);
import void OPC_GenHdrIncludes (void);
import void OPC_Halt (int32 n);
import void OPC_Halt (INT32 n);
import void OPC_Ident (OPT_Object obj);
import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (int16 count);
import void OPC_Indent (INT16 count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (int64 n, int32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
import void OPC_IntLiteral (INT64 n, INT32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
import BOOLEAN OPC_NeedsRetval (OPT_Object proc);
import int32 OPC_NofPtrs (OPT_Struct typ);
import INT32 OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);
import void OPC_TDescDecl (OPT_Struct typ);
import void OPC_TypeDefs (OPT_Object obj, int16 vis);
import void OPC_TypeDefs (OPT_Object obj, INT16 vis);
import void OPC_TypeOf (OPT_Object ap);
import void *OPC__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -22,81 +22,81 @@ typedef
static CHAR OPM_SourceFileName[256];
static CHAR OPM_GlobalModel[10];
export CHAR OPM_Model[10];
static int16 OPM_GlobalAddressSize;
export int16 OPM_AddressSize;
static int16 OPM_GlobalAlignment;
export int16 OPM_Alignment;
export uint32 OPM_GlobalOptions, OPM_Options;
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export int64 OPM_MaxIndex;
static INT16 OPM_GlobalAddressSize;
export INT16 OPM_AddressSize;
static INT16 OPM_GlobalAlignment;
export INT16 OPM_Alignment;
export UINT32 OPM_GlobalOptions, OPM_Options;
export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export INT64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr;
export int32 OPM_curpos, OPM_errpos, OPM_breakpc;
export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Writer OPM_W;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
static int16 OPM_S;
static INT16 OPM_S;
export CHAR OPM_ResourceDir[1024];
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F);
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F);
export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void);
export void OPM_DeleteNewSym (void);
export void OPM_FPrint (int32 *fp, int64 val);
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
export void OPM_FPrintReal (int32 *fp, REAL real);
export void OPM_FPrintSet (int32 *fp, uint64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
export void OPM_FPrint (INT32 *fp, INT64 val);
export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
export void OPM_FPrintReal (INT32 *fp, REAL real);
export void OPM_FPrintSet (INT32 *fp, UINT64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
export void OPM_Get (CHAR *ch);
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
export void OPM_InitOptions (void);
export int16 OPM_Integer (int64 n);
static void OPM_LogErrMsg (int16 n);
export INT16 OPM_Integer (INT64 n);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogW (CHAR ch);
export void OPM_LogWLn (void);
export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWNum (INT64 i, INT64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n);
export INT32 OPM_Longint (INT64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int32 pos);
export void OPM_Mark (INT16 n, INT32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
export BOOLEAN OPM_OpenPar (void);
export void OPM_RegisterNewSym (void);
static void OPM_ScanOptions (CHAR *s, LONGINT s__len);
static void OPM_ShowLine (int64 pos);
export int64 OPM_SignedMaximum (int32 bytecount);
export int64 OPM_SignedMinimum (int32 bytecount);
static void OPM_ShowLine (INT64 pos);
export INT64 OPM_SignedMaximum (INT32 bytecount);
export INT64 OPM_SignedMinimum (INT32 bytecount);
export void OPM_SymRCh (CHAR *ch);
export int32 OPM_SymRInt (void);
export int64 OPM_SymRInt64 (void);
export INT32 OPM_SymRInt (void);
export INT64 OPM_SymRInt64 (void);
export void OPM_SymRLReal (LONGREAL *lr);
export void OPM_SymRReal (REAL *r);
export void OPM_SymRSet (uint64 *s);
export void OPM_SymRSet (UINT64 *s);
export void OPM_SymWCh (CHAR ch);
export void OPM_SymWInt (int64 i);
export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (uint64 s);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (int64 i);
export void OPM_WriteInt (int64 i);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
export void OPM_WriteLn (void);
export void OPM_WriteReal (LONGREAL r, CHAR suffx);
export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void);
export void OPM_err (int16 n);
export void OPM_err (INT16 n);
#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s
@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len)
__DEL(s);
}
void OPM_LogWNum (int64 i, int64 len)
void OPM_LogWNum (INT64 i, INT64 len)
{
Out_Int(i, len);
}
@ -122,32 +122,32 @@ void OPM_LogWLn (void)
Out_Ln();
}
int64 OPM_SignedMaximum (int32 bytecount)
INT64 OPM_SignedMaximum (INT32 bytecount)
{
int64 result;
INT64 result;
result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
return result - 1;
}
int64 OPM_SignedMinimum (int32 bytecount)
INT64 OPM_SignedMinimum (INT32 bytecount)
{
return -OPM_SignedMaximum(bytecount) - 1;
}
int32 OPM_Longint (int64 n)
INT32 OPM_Longint (INT64 n)
{
return __VAL(int32, n);
return __VAL(INT32, n);
}
int16 OPM_Integer (int64 n)
INT16 OPM_Integer (INT64 n)
{
return __VAL(int16, n);
return __VAL(INT16, n);
}
static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
i = 1;
while (s[__X(i, s__len)] != 0x00) {
@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
OPM_LogWLn();
} else {
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48;
i += 2;
}
break;
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
@ -465,7 +465,7 @@ void OPM_InitOptions (void)
void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
{
Texts_Text T = NIL;
int32 beg, end, time;
INT32 beg, end, time;
CHAR s[256];
*done = 0;
OPM_curpos = 0;
@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch)
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len)
{
int16 i, j;
INT16 i, j;
CHAR ch;
__DUP(ext, ext__len, CHAR);
i = 0;
@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
__DEL(ext);
}
static void OPM_LogErrMsg (int16 n)
static void OPM_LogErrMsg (INT16 n)
{
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
int16 i;
INT16 i;
CHAR buf[1024];
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n)
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos)
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
{
CHAR ch, cheol;
if (pos < (int64)OPM_ErrorLineStartPos) {
if (pos < (INT64)OPM_ErrorLineStartPos) {
OPM_ErrorLineStartPos = 0;
OPM_ErrorLineLimitPos = 0;
OPM_ErrorLineNumber = 0;
}
if (pos < (int64)OPM_ErrorLineLimitPos) {
if (pos < (INT64)OPM_ErrorLineLimitPos) {
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
return;
}
Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos);
Files_Read(&*r, r__typ, (void*)&ch);
while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos;
OPM_ErrorLineNumber += 1;
while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) {
@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
}
static void OPM_ShowLine (int64 pos)
static void OPM_ShowLine (INT64 pos)
{
Files_File f = NIL;
Files_Rider r;
CHAR line[1023];
int16 i;
INT16 i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos)
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= (int64)OPM_ErrorLineLimitPos) {
if (pos >= (INT64)OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos);
i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f);
}
void OPM_Mark (int16 n, int32 pos)
void OPM_Mark (INT16 n, INT32 pos)
{
if (pos == -1) {
pos = 0;
@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos)
}
}
void OPM_err (int16 n)
void OPM_err (INT16 n)
{
OPM_Mark(n, OPM_errpos);
}
void OPM_FPrint (int32 *fp, int64 val)
void OPM_FPrint (INT32 *fp, INT64 val)
{
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
*fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32);
}
void OPM_FPrintSet (int32 *fp, uint64 set)
void OPM_FPrintSet (INT32 *fp, UINT64 set)
{
OPM_FPrint(&*fp, __VAL(int32, set));
OPM_FPrint(&*fp, __VAL(INT32, set));
}
void OPM_FPrintReal (int32 *fp, REAL real)
void OPM_FPrintReal (INT32 *fp, REAL real)
{
int16 i;
int32 l;
__GET((address)&real, l, int32);
INT16 i;
INT32 l;
__GET((address)&real, l, INT32);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (int32 *fp, LONGREAL lr)
void OPM_FPrintLReal (INT32 *fp, LONGREAL lr)
{
int32 l, h;
__GET((address)&lr, l, int32);
__GET((address)&lr + 4, h, int32);
INT32 l, h;
__GET((address)&lr, l, INT32);
__GET((address)&lr + 4, h, INT32);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}
@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch)
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch);
}
int32 OPM_SymRInt (void)
INT32 OPM_SymRInt (void)
{
int32 k;
INT32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
return k;
}
int64 OPM_SymRInt64 (void)
INT64 OPM_SymRInt64 (void)
{
int64 k;
INT64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
return k;
}
void OPM_SymRSet (uint64 *s)
void OPM_SymRSet (UINT64 *s)
{
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8);
}
@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch)
Files_Write(&OPM_newSF, Files_Rider__typ, ch);
}
void OPM_SymWInt (int64 i)
void OPM_SymWInt (INT64 i)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
}
void OPM_SymWSet (uint64 s)
void OPM_SymWSet (UINT64 s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s);
}
void OPM_SymWReal (REAL r)
@ -841,7 +841,7 @@ void OPM_Write (CHAR ch)
void OPM_WriteString (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (int64 i)
void OPM_WriteHex (INT64 i)
{
CHAR s[3];
int32 digit;
digit = __ASHR((int32)i, 4);
INT32 digit;
digit = __ASHR((INT32)i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int32)i, -16);
digit = __MASK((INT32)i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i)
OPM_WriteString(s, 3);
}
void OPM_WriteInt (int64 i)
void OPM_WriteInt (INT64 i)
{
CHAR s[24];
int64 i1, k;
INT64 i1, k;
if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_Reader R;
CHAR s[32];
CHAR ch;
int16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
INT16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt((int32)__ENTIER(r));
OPM_WriteInt((INT32)__ENTIER(r));
} else {
Texts_OpenWriter(&W, Texts_Writer__typ);
if (suffx == 'f') {
@ -960,7 +960,7 @@ void OPM_WriteLn (void)
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F)
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F)
{
Files_Rider R1;
CHAR buffer[4096];
@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
void OPM_CloseFiles (void)
{
CHAR FName[32];
int16 res;
INT16 res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPM__h
#define OPM__h
@ -7,14 +7,14 @@
import CHAR OPM_Model[10];
import int16 OPM_AddressSize, OPM_Alignment;
import uint32 OPM_GlobalOptions, OPM_Options;
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import int64 OPM_MaxIndex;
import INT16 OPM_AddressSize, OPM_Alignment;
import UINT32 OPM_GlobalOptions, OPM_Options;
import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import INT64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr;
import int32 OPM_curpos, OPM_errpos, OPM_breakpc;
import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import CHAR OPM_modName[32];
import CHAR OPM_objname[64];
import CHAR OPM_ResourceDir[1024];
@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024];
import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void);
import void OPM_FPrint (int32 *fp, int64 val);
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
import void OPM_FPrintReal (int32 *fp, REAL real);
import void OPM_FPrintSet (int32 *fp, uint64 set);
import void OPM_FPrint (INT32 *fp, INT64 val);
import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
import void OPM_FPrintReal (INT32 *fp, REAL real);
import void OPM_FPrintSet (INT32 *fp, UINT64 set);
import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
import void OPM_InitOptions (void);
import int16 OPM_Integer (int64 n);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWNum (INT64 i, INT64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int32 pos);
import INT32 OPM_Longint (INT64 n);
import void OPM_Mark (INT16 n, INT32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
import BOOLEAN OPM_OpenPar (void);
import void OPM_RegisterNewSym (void);
import int64 OPM_SignedMaximum (int32 bytecount);
import int64 OPM_SignedMinimum (int32 bytecount);
import INT64 OPM_SignedMaximum (INT32 bytecount);
import INT64 OPM_SignedMinimum (INT32 bytecount);
import void OPM_SymRCh (CHAR *ch);
import int32 OPM_SymRInt (void);
import int64 OPM_SymRInt64 (void);
import INT32 OPM_SymRInt (void);
import INT64 OPM_SymRInt64 (void);
import void OPM_SymRLReal (LONGREAL *lr);
import void OPM_SymRReal (REAL *r);
import void OPM_SymRSet (uint64 *s);
import void OPM_SymRSet (UINT64 *s);
import void OPM_SymWCh (CHAR ch);
import void OPM_SymWInt (int64 i);
import void OPM_SymWInt (INT64 i);
import void OPM_SymWLReal (LONGREAL lr);
import void OPM_SymWReal (REAL r);
import void OPM_SymWSet (uint64 s);
import void OPM_SymWSet (UINT64 s);
import void OPM_Write (CHAR ch);
import void OPM_WriteHex (int64 i);
import void OPM_WriteInt (int64 i);
import void OPM_WriteHex (INT64 i);
import void OPM_WriteInt (INT64 i);
import void OPM_WriteLn (void);
import void OPM_WriteReal (LONGREAL r, CHAR suffx);
import void OPM_WriteString (CHAR *s, LONGINT s__len);
import void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
import BOOLEAN OPM_eofSF (void);
import void OPM_err (int16 n);
import void OPM_err (INT16 n);
import void *OPM__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPB.h"
@ -12,38 +12,38 @@
#include "OPT.h"
struct OPP__1 {
int32 low, high;
INT32 low, high;
};
typedef
struct OPP__1 OPP_CaseTable[128];
static int8 OPP_sym, OPP_level;
static int16 OPP_LoopLevel;
static INT8 OPP_sym, OPP_level;
static INT16 OPP_LoopLevel;
static OPT_Node OPP_TDinit, OPP_lastTDinit;
static int16 OPP_nofFwdPtr;
static INT16 OPP_nofFwdPtr;
static OPT_Struct OPP_FwdPtr[64];
export address *OPP__1__typ;
export ADDRESS *OPP__1__typ;
static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar);
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (int8 *vis);
static void OPP_CheckSym (int16 s);
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (INT8 *vis);
static void OPP_CheckSym (INT16 s);
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_);
static void OPP_ConstExpression (OPT_Node *x);
static void OPP_Element (OPT_Node *x);
static void OPP_Expression (OPT_Node *x);
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
static void OPP_Factor (OPT_Node *x);
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
export void OPP_Module (OPT_Node *prog, uint32 opt);
export void OPP_Module (OPT_Node *prog, UINT32 opt);
static void OPP_PointerType (OPT_Struct *typ);
static void OPP_ProcedureDeclaration (OPT_Node *x);
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Sets (OPT_Node *x);
static void OPP_SimpleExpression (OPT_Node *x);
@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat);
static void OPP_Term (OPT_Node *x);
static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_err (int16 n);
static void OPP_err (INT16 n);
static void OPP_qualident (OPT_Object *id);
static void OPP_selector (OPT_Node *x);
static void OPP_err (int16 n)
static void OPP_err (INT16 n)
{
OPM_err(n);
}
static void OPP_CheckSym (int16 s)
static void OPP_CheckSym (INT16 s)
{
if ((int16)OPP_sym == s) {
if ((INT16)OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s)
static void OPP_qualident (OPT_Object *id)
{
OPT_Object obj = NIL;
int8 lev;
INT8 lev;
OPT_Find(&obj);
OPS_Get(&OPP_sym);
if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) {
@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x)
}
}
static void OPP_CheckMark (int8 *vis)
static void OPP_CheckMark (INT8 *vis)
{
OPS_Get(&OPP_sym);
if (OPP_sym == 1 || OPP_sym == 7) {
@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis)
}
}
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_)
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_)
{
OPT_Node x = NIL;
int64 sf;
INT64 sf;
if (OPP_sym == 31) {
OPS_Get(&OPP_sym);
if (!OPT_SYSimported) {
@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL;
OPT_Struct ftyp = NIL;
int16 sysflag;
INT16 sysflag;
*typ = OPT_NewStr(13, 4);
(*typ)->BaseTyp = NIL;
OPP_CheckSysFlag(&sysflag, -1);
@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Node x = NIL;
int64 n;
int16 sysflag;
INT64 n;
INT16 sysflag;
OPP_CheckSysFlag(&sysflag, 0);
if (OPP_sym == 25) {
*typ = OPT_NewStr(13, 3);
@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ)
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp)
{
int8 mode;
INT8 mode;
OPT_Object par = NIL, first = NIL, last = NIL, res = NIL;
OPT_Struct typ = NIL;
first = NIL;
@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar)
static void OPP_StandProcCall (OPT_Node *x)
{
OPT_Node y = NIL;
int8 m;
int16 n;
m = (int8)((int16)(*x)->obj->adr);
INT8 m;
INT16 n;
m = (INT8)((INT16)(*x)->obj->adr);
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x)
static void OPP_Term (OPT_Node *x)
{
OPT_Node y = NIL;
int8 mulop;
INT8 mulop;
OPP_Factor(&*x);
while ((1 <= OPP_sym && OPP_sym <= 5)) {
mulop = OPP_sym;
@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x)
static void OPP_SimpleExpression (OPT_Node *x)
{
OPT_Node y = NIL;
int8 addop;
INT8 addop;
if (OPP_sym == 7) {
OPS_Get(&OPP_sym);
OPP_Term(&*x);
@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x)
{
OPT_Node y = NIL;
OPT_Object obj = NIL;
int8 relation;
INT8 relation;
OPP_SimpleExpression(&*x);
if ((9 <= OPP_sym && OPP_sym <= 14)) {
relation = OPP_sym;
@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x)
}
}
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
{
OPT_Object obj = NIL;
*typ = OPT_undftyp;
@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 {
OPT_Node *x;
OPT_Object *proc, *fwd;
OPS_Name *name;
int8 *mode, *vis;
INT8 *mode, *vis;
BOOLEAN *forward;
struct ProcedureDeclaration__16 *lnk;
} *ProcedureDeclaration__16_s;
@ -930,8 +930,8 @@ static void TProcDecl__23 (void);
static void GetCode__19 (void)
{
OPT_ConstExt ext = NIL;
int16 n;
int64 c;
INT16 n;
INT64 c;
ext = OPT_NewExt();
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
@ -995,7 +995,7 @@ static void GetParams__21 (void)
static void Body__17 (void)
{
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
c = OPM_errpos;
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64);
OPP_CheckSym(39);
@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void)
{
OPT_Object baseProc = NIL;
OPT_Struct objTyp = NIL, recTyp = NIL;
int8 objMode;
INT8 objMode;
OPS_Name objName;
OPS_Get(&OPP_sym);
*ProcedureDeclaration__16_s->mode = 13;
@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
{
OPT_Object proc = NIL, fwd = NIL;
OPS_Name name;
int8 mode, vis;
INT8 mode, vis;
BOOLEAN forward;
struct ProcedureDeclaration__16 _s;
_s.x = x;
@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
ProcedureDeclaration__16_s = _s.lnk;
}
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab)
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab)
{
OPT_Node x = NIL, y = NIL, lastlab = NIL;
int16 i, f;
int32 xval, yval;
INT16 i, f;
INT32 xval, yval;
*lab = NIL;
lastlab = NIL;
for (;;) {
@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int16)LabelTyp->form != f) {
} else if ((INT16)LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = OPM_Longint(y->conval->intval);
if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
OPP_err(60);
}
if (yval < xval) {
@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
}
static struct StatSeq__30 {
int32 *pos;
INT32 *pos;
struct StatSeq__30 *lnk;
} *StatSeq__30_s;
@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x);
static void CasePart__31 (OPT_Node *x)
{
int16 n;
int32 low, high;
INT16 n;
INT32 low, high;
BOOLEAN e;
OPP_CaseTable tab;
OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL;
@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPT_Struct idtyp = NIL;
BOOLEAN e;
OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL;
int32 pos;
INT32 pos;
OPS_Name name;
struct StatSeq__30 _s;
_s.pos = &pos;
@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPT_Struct typ = NIL;
OPT_Object obj = NIL, first = NIL, last = NIL;
OPT_Node x = NIL, lastdec = NIL;
int16 i;
INT16 i;
first = NIL;
last = NIL;
OPP_nofFwdPtr = 0;
@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_CheckSym(41);
}
void OPP_Module (OPT_Node *prog, uint32 opt)
void OPP_Module (OPT_Node *prog, UINT32 opt)
{
OPS_Name impName, aliasName;
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
BOOLEAN done;
OPS_Init();
OPP_LoopLevel = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPP__h
#define OPP__h
@ -9,7 +9,7 @@
import void OPP_Module (OPT_Node *prog, uint32 opt);
import void OPP_Module (OPT_Node *prog, UINT32 opt);
import void *OPP__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -17,29 +17,29 @@ typedef
export OPS_Name OPS_name;
export OPS_String OPS_str;
export int16 OPS_numtyp;
export int64 OPS_intval;
export INT16 OPS_numtyp;
export INT64 OPS_intval;
export REAL OPS_realval;
export LONGREAL OPS_lrlval;
static CHAR OPS_ch;
export void OPS_Get (int8 *sym);
static void OPS_Identifier (int8 *sym);
export void OPS_Get (INT8 *sym);
static void OPS_Identifier (INT8 *sym);
export void OPS_Init (void);
static void OPS_Number (void);
static void OPS_Str (int8 *sym);
static void OPS_err (int16 n);
static void OPS_Str (INT8 *sym);
static void OPS_err (INT16 n);
static void OPS_err (int16 n)
static void OPS_err (INT16 n)
{
OPM_err(n);
}
static void OPS_Str (int8 *sym)
static void OPS_Str (INT8 *sym)
{
int16 i;
INT16 i;
CHAR och;
i = 0;
och = OPS_ch;
@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int16)OPS_str[0];
OPS_intval = (INT16)OPS_str[0];
} else {
*sym = 37;
}
}
static void OPS_Identifier (int8 *sym)
static void OPS_Identifier (INT8 *sym)
{
int16 i;
INT16 i;
i = 0;
do {
OPS_name[i] = OPS_ch;
@ -92,10 +92,10 @@ static struct Number__6 {
struct Number__6 *lnk;
} *Number__6_s;
static int16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (int16 e);
static INT16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (INT16 e);
static LONGREAL Ten__9 (int16 e)
static LONGREAL Ten__9 (INT16 e)
{
LONGREAL x, p;
x = (LONGREAL)1;
@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e)
return x;
}
static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static INT16 Ord__7 (CHAR ch, BOOLEAN hex)
{
if (ch <= '9') {
return (int16)ch - 48;
return (INT16)ch - 48;
} else if (hex) {
return ((int16)ch - 65) + 10;
return ((INT16)ch - 65) + 10;
} else {
OPS_err(2);
return 0;
@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static void OPS_Number (void)
{
int16 i, m, n, d, e;
INT16 i, m, n, d, e;
CHAR dig[24];
LONGREAL f;
CHAR expCh;
@ -173,7 +173,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -187,7 +187,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -198,8 +198,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) {
OPS_intval = OPS_intval * 10 + (int64)d;
if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) {
OPS_intval = OPS_intval * 10 + (INT64)d;
} else {
OPS_err(203);
}
@ -308,9 +308,9 @@ static void Comment__2 (void)
}
}
void OPS_Get (int8 *sym)
void OPS_Get (INT8 *sym)
{
int8 s;
INT8 s;
struct Get__1 _s;
_s.lnk = Get__1_s;
Get__1_s = &_s;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef OPS__h
#define OPS__h
@ -14,13 +14,13 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import INT16 OPS_numtyp;
import INT64 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;
import void OPS_Get (int8 *sym);
import void OPS_Get (INT8 *sym);
import void OPS_Init (void);
import void *OPS__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -18,18 +18,18 @@ typedef
typedef
struct OPT_ConstDesc {
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint64 setval;
INT64 intval;
INT32 intval2;
UINT64 setval;
LONGREAL realval;
} OPT_ConstDesc;
typedef
struct OPT_ExpCtxt {
int32 reffp;
int16 ref;
int8 nofm;
int8 locmno[64];
INT32 reffp;
INT16 ref;
INT8 nofm;
INT8 locmno[64];
} OPT_ExpCtxt;
typedef
@ -40,13 +40,13 @@ typedef
typedef
struct OPT_ImpCtxt {
int32 nextTag, reffp;
int16 nofr, minr, nofm;
INT32 nextTag, reffp;
INT16 nofr, minr, nofm;
BOOLEAN self;
OPT_Struct ref[255];
OPT_Object old[255];
int32 pvfp[255];
int8 glbmno[64];
INT32 pvfp[255];
INT8 glbmno[64];
} OPT_ImpCtxt;
typedef
@ -55,7 +55,7 @@ typedef
typedef
struct OPT_NodeDesc {
OPT_Node left, right, link;
int8 class, subcl;
INT8 class, subcl;
BOOLEAN readonly;
OPT_Struct typ;
OPT_Object obj;
@ -67,22 +67,22 @@ typedef
OPT_Object left, right, link, scope;
OPS_Name name;
BOOLEAN leaf;
int8 mode, mnolev, vis, history;
INT8 mode, mnolev, vis, history;
BOOLEAN used, fpdone;
int32 fprint;
INT32 fprint;
OPT_Struct typ;
OPT_Const conval;
int32 adr, linkadr;
int16 x;
INT32 adr, linkadr;
INT16 x;
} OPT_ObjDesc;
typedef
struct OPT_StrDesc {
int8 form, comp, mno, extlev;
int16 ref, sysflag;
int32 n, size, align, txtpos;
INT8 form, comp, mno, extlev;
INT16 ref, sysflag;
INT32 n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused, fpdone, idfpdone;
int32 idfp, pbfp, pvfp;
INT32 idfp, pbfp, pvfp;
OPT_Struct BaseTyp;
OPT_Object link, strobj;
} OPT_StrDesc;
@ -91,80 +91,80 @@ typedef
export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
export int8 OPT_nofGmod;
export INT8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64];
export OPS_Name OPT_SelfName;
export BOOLEAN OPT_SYSimported;
static OPT_Object OPT_universe, OPT_syslink;
static OPT_ImpCtxt OPT_impCtxt;
static OPT_ExpCtxt OPT_expCtxt;
static int32 OPT_nofhdfld;
static INT32 OPT_nofhdfld;
static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew;
static int32 OPT_recno;
static INT32 OPT_recno;
export address *OPT_ConstDesc__typ;
export address *OPT_ObjDesc__typ;
export address *OPT_StrDesc__typ;
export address *OPT_NodeDesc__typ;
export address *OPT_ImpCtxt__typ;
export address *OPT_ExpCtxt__typ;
export ADDRESS *OPT_ConstDesc__typ;
export ADDRESS *OPT_ObjDesc__typ;
export ADDRESS *OPT_StrDesc__typ;
export ADDRESS *OPT_NodeDesc__typ;
export ADDRESS *OPT_ImpCtxt__typ;
export ADDRESS *OPT_ExpCtxt__typ;
export void OPT_Align (int32 *adr, int32 base);
export int32 OPT_BaseAlignment (OPT_Struct typ);
export void OPT_Align (INT32 *adr, INT32 base);
export INT32 OPT_BaseAlignment (OPT_Struct typ);
export void OPT_Close (void);
export void OPT_CloseScope (void);
static void OPT_DebugStruct (OPT_Struct btyp);
static void OPT_EnterBoolConst (OPS_Name name, int32 value);
static void OPT_EnterProc (OPS_Name name, int16 num);
static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res);
static void OPT_EnterBoolConst (OPS_Name name, INT32 value);
static void OPT_EnterProc (OPS_Name name, INT16 num);
static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res);
static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res);
export void OPT_Export (BOOLEAN *ext, BOOLEAN *new);
export void OPT_FPrintErr (OPT_Object obj, int16 errcode);
static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintErr (OPT_Object obj, INT16 errcode);
static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintObj (OPT_Object obj);
static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par);
static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par);
export void OPT_FPrintStr (OPT_Struct typ);
export void OPT_Find (OPT_Object *res);
export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
export void OPT_FindImport (OPT_Object mod, OPT_Object *res);
export void OPT_IdFPrint (OPT_Struct typ);
export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
static void OPT_InConstant (int32 f, OPT_Const conval);
static void OPT_InConstant (INT32 f, OPT_Const conval);
static OPT_Object OPT_InFld (void);
static void OPT_InMod (int8 *mno);
static void OPT_InMod (INT8 *mno);
static void OPT_InName (CHAR *name, LONGINT name__len);
static OPT_Object OPT_InObj (int8 mno);
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
static OPT_Object OPT_InObj (INT8 mno);
static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par);
static void OPT_InStruct (OPT_Struct *typ);
static OPT_Object OPT_InTProc (int8 mno);
static OPT_Struct OPT_InTyp (int32 tag);
export void OPT_Init (OPS_Name name, uint32 opt);
static OPT_Object OPT_InTProc (INT8 mno);
static OPT_Struct OPT_InTyp (INT32 tag);
export void OPT_Init (OPS_Name name, UINT32 opt);
export void OPT_InitRecno (void);
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
static void OPT_InitStruct (OPT_Struct *typ, INT8 form);
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
export int16 OPT_IntSize (int64 n);
export OPT_Struct OPT_IntType (int32 size);
export INT16 OPT_IntSize (INT64 n);
export OPT_Struct OPT_IntType (INT32 size);
export OPT_Const OPT_NewConst (void);
export OPT_ConstExt OPT_NewExt (void);
export OPT_Node OPT_NewNode (int8 class);
export OPT_Node OPT_NewNode (INT8 class);
export OPT_Object OPT_NewObj (void);
export OPT_Struct OPT_NewStr (int8 form, int8 comp);
export void OPT_OpenScope (int8 level, OPT_Object owner);
export OPT_Struct OPT_NewStr (INT8 form, INT8 comp);
export void OPT_OpenScope (INT8 level, OPT_Object owner);
static void OPT_OutConstant (OPT_Object obj);
static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr);
static void OPT_OutMod (int16 mno);
static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr);
static void OPT_OutMod (INT16 mno);
static void OPT_OutName (CHAR *name, LONGINT name__len);
static void OPT_OutObj (OPT_Object obj);
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
static void OPT_OutStr (OPT_Struct typ);
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
export OPT_Struct OPT_SetType (int32 size);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
export int32 OPT_SizeAlignment (int32 size);
export OPT_Struct OPT_SetType (INT32 size);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
export INT32 OPT_SizeAlignment (INT32 size);
export void OPT_TypSize (OPT_Struct typ);
static void OPT_err (int16 n);
static void OPT_err (INT16 n);
void OPT_InitRecno (void)
@ -172,14 +172,14 @@ void OPT_InitRecno (void)
OPT_recno = 0;
}
static void OPT_err (int16 n)
static void OPT_err (INT16 n)
{
OPM_err(n);
}
int16 OPT_IntSize (int64 n)
INT16 OPT_IntSize (INT64 n)
{
int16 bytes;
INT16 bytes;
if (n < 0) {
n = -(n + 1);
}
@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n)
return bytes;
}
OPT_Struct OPT_IntType (int32 size)
OPT_Struct OPT_IntType (INT32 size)
{
if (size <= OPT_int8typ->size) {
return OPT_int8typ;
@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size)
return OPT_int64typ;
}
OPT_Struct OPT_SetType (int32 size)
OPT_Struct OPT_SetType (INT32 size)
{
if (size == OPT_set32typ->size) {
return OPT_set32typ;
@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size)
return OPT_set64typ;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir)
{
int16 i;
INT16 i;
__ASSERT(x->form == 4, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
__ASSERT(dir == 1 || dir == -1, 0);
@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
__RETCHK;
}
void OPT_Align (int32 *adr, int32 base)
void OPT_Align (INT32 *adr, INT32 base)
{
switch (base) {
case 2:
@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base)
}
}
int32 OPT_SizeAlignment (int32 size)
INT32 OPT_SizeAlignment (INT32 size)
{
int32 alignment;
INT32 alignment;
if (size < OPM_Alignment) {
alignment = 1;
while (alignment < size) {
@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size)
return alignment;
}
int32 OPT_BaseAlignment (OPT_Struct typ)
INT32 OPT_BaseAlignment (OPT_Struct typ)
{
int32 alignment;
INT32 alignment;
if (typ->form == 13) {
if (typ->comp == 4) {
alignment = __MASK(typ->align, -65536);
@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ)
void OPT_TypSize (OPT_Struct typ)
{
int16 f, c;
int32 offset, size, base, fbase, off0;
INT16 f, c;
INT32 offset, size, base, fbase, off0;
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
if (typ == OPT_undftyp) {
@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ)
}
typ->size = offset;
typ->align = base;
typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8);
typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8);
} else if (c == 2) {
OPT_TypSize(typ->BaseTyp);
typ->size = typ->n * typ->BaseTyp->size;
@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void)
return obj;
}
OPT_Struct OPT_NewStr (int8 form, int8 comp)
OPT_Struct OPT_NewStr (INT8 form, INT8 comp)
{
OPT_Struct typ = NIL;
__NEW(typ, OPT_StrDesc);
@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp)
return typ;
}
OPT_Node OPT_NewNode (int8 class)
OPT_Node OPT_NewNode (INT8 class)
{
OPT_Node node = NIL;
__NEW(node, OPT_NodeDesc);
@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void)
return ext;
}
void OPT_OpenScope (int8 level, OPT_Object owner)
void OPT_OpenScope (INT8 level, OPT_Object owner)
{
OPT_Object head = NIL;
head = OPT_NewObj();
@ -429,7 +429,7 @@ void OPT_CloseScope (void)
OPT_topScope = OPT_topScope->left;
}
void OPT_Init (OPS_Name name, uint32 opt)
void OPT_Init (OPS_Name name, UINT32 opt)
{
OPT_topScope = OPT_universe;
OPT_OpenScope(0, NIL);
@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt)
void OPT_Close (void)
{
int16 i;
INT16 i;
OPT_CloseScope();
i = 0;
while (i < 64) {
@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
{
OPT_Object ob0 = NIL, ob1 = NIL;
BOOLEAN left;
int8 mnolev;
INT8 mnolev;
ob0 = OPT_topScope;
ob1 = ob0->right;
left = 0;
@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
*obj = ob1;
}
static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len)
static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
ch = name[__X(i, name__len)];
OPM_FPrint(&*fp, (int16)ch);
OPM_FPrint(&*fp, (INT16)ch);
i += 1;
} while (!(ch == 0x00));
}
@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp)
OPM_LogWLn();
}
static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par)
static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par)
{
OPT_IdFPrint(result);
OPM_FPrint(&*fp, result->idfp);
@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ)
{
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL;
int32 idfp;
int16 f, c;
INT32 idfp;
INT16 f, c;
if (!typ->idfpdone) {
typ->idfpdone = 1;
idfp = 0;
@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ)
}
static struct FPrintStr__15 {
int32 *pbfp, *pvfp;
INT32 *pbfp, *pvfp;
struct FPrintStr__15 *lnk;
} *FPrintStr__15_s;
static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr);
static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr);
static void FPrintTProcs__20 (OPT_Object obj);
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr)
static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr)
{
int32 i, j, n;
INT32 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
FPrintFlds__16(typ->link, adr, 0);
@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr)
}
}
static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible)
static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj)
void OPT_FPrintStr (OPT_Struct typ)
{
int16 f, c;
INT16 f, c;
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL, bstrobj = NIL;
int32 pbfp, pvfp;
INT32 pbfp, pvfp;
struct FPrintStr__15 _s;
_s.pbfp = &pbfp;
_s.pvfp = &pvfp;
@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ)
void OPT_FPrintObj (OPT_Object obj)
{
int32 fprint;
int16 f, m;
INT32 fprint;
INT16 f, m;
REAL rval;
OPT_ConstExt ext = NIL;
if (!obj->fpdone) {
@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj)
} else if (obj->mode == 9) {
OPT_FPrintSign(&fprint, obj->typ, obj->link);
ext = obj->conval->ext;
m = (int16)(*ext)[0];
m = (INT16)(*ext)[0];
f = 1;
OPM_FPrint(&fprint, m);
while (f <= m) {
OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]);
OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]);
f += 1;
}
} else if (obj->mode == 5) {
@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj)
}
}
void OPT_FPrintErr (OPT_Object obj, int16 errcode)
void OPT_FPrintErr (OPT_Object obj, INT16 errcode)
{
int16 i, j;
INT16 i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old)
static void OPT_InName (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_InMod (int8 *mno)
static void OPT_InMod (INT8 *mno)
{
OPT_Object head = NIL;
OPS_Name name;
int32 mn;
int8 i;
INT32 mn;
INT8 i;
mn = OPM_SymRInt();
if (mn == 0) {
*mno = OPT_impCtxt.glbmno[0];
@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno)
}
}
static void OPT_InConstant (int32 f, OPT_Const conval)
static void OPT_InConstant (INT32 f, OPT_Const conval)
{
CHAR ch;
int16 i;
INT16 i;
OPT_ConstExt ext = NIL;
REAL rval;
switch (f) {
case 1: case 3: case 2:
OPM_SymRCh(&ch);
conval->intval = (int16)ch;
conval->intval = (INT16)ch;
break;
case 4:
conval->intval = OPM_SymRInt();
@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval)
}
}
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par)
{
OPT_Object last = NIL, new = NIL;
int32 tag;
INT32 tag;
OPT_InStruct(&*res);
tag = OPM_SymRInt();
last = NIL;
@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void)
{
int32 tag;
INT32 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void)
return obj;
}
static OPT_Object OPT_InTProc (int8 mno)
static OPT_Object OPT_InTProc (INT8 mno)
{
int32 tag;
INT32 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno)
return obj;
}
static OPT_Struct OPT_InTyp (int32 tag)
static OPT_Struct OPT_InTyp (INT32 tag)
{
if (tag == 4) {
return OPT_IntType(OPM_SymRInt());
@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag)
static void OPT_InStruct (OPT_Struct *typ)
{
int8 mno;
int16 ref;
int32 tag;
INT8 mno;
INT16 ref;
INT32 tag;
OPS_Name name;
OPT_Struct t = NIL;
OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL;
@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (int16)OPM_SymRInt();
(*typ)->sysflag = (INT16)OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ)
}
}
static OPT_Object OPT_InObj (int8 mno)
static OPT_Object OPT_InObj (INT8 mno)
{
int16 i, s;
INT16 i, s;
CHAR ch;
OPT_Object obj = NIL, old = NIL;
OPT_Struct typ = NIL;
int32 tag;
INT32 tag;
OPT_ConstExt ext = NIL;
tag = OPT_impCtxt.nextTag;
if (tag == 19) {
@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (int16)OPM_SymRInt();
s = (INT16)OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno)
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
{
OPT_Object obj = NIL;
int8 mno;
INT8 mno;
OPS_Name aliasName__copy;
__DUPARR(aliasName, OPS_Name);
if (__STRCMP(name, "SYSTEM") == 0) {
@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
static void OPT_OutName (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_OutMod (int16 mno)
static void OPT_OutMod (INT16 mno)
{
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno)
}
}
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr)
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr)
{
int32 i, j, n;
INT32 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
OPT_OutFlds(typ->link, adr, 0);
@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr)
}
}
static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible)
static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ)
static void OPT_OutConstant (OPT_Object obj)
{
int16 f;
INT16 f;
REAL rval;
f = obj->typ->form;
OPM_SymWInt(f);
@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj)
static void OPT_OutObj (OPT_Object obj)
{
int16 i, j;
INT16 i, j;
OPT_ConstExt ext = NIL;
if (obj != NIL) {
OPT_OutObj(obj->left);
@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj)
OPM_SymWInt(33);
OPT_OutSign(obj->typ, obj->link);
ext = obj->conval->ext;
j = (int16)(*ext)[0];
j = (INT16)(*ext)[0];
i = 1;
OPM_SymWInt(j);
while (i <= j) {
@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj)
void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
{
int16 i;
int8 nofmod;
INT16 i;
INT8 nofmod;
BOOLEAN done;
OPT_symExtended = 0;
OPT_symNew = 0;
@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
}
}
static void OPT_InitStruct (OPT_Struct *typ, int8 form)
static void OPT_InitStruct (OPT_Struct *typ, INT8 form)
{
*typ = OPT_NewStr(form, 1);
(*typ)->ref = form;
@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
(*typ)->idfpdone = 1;
}
static void OPT_EnterBoolConst (OPS_Name name, int32 value)
static void OPT_EnterBoolConst (OPS_Name name, INT32 value)
{
OPT_Object obj = NIL;
OPS_Name name__copy;
@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value)
obj->conval->intval = value;
}
static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res)
static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res)
{
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res)
*res = obj;
}
static void OPT_EnterProc (OPS_Name name, int16 num)
static void OPT_EnterProc (OPS_Name name, INT16 num)
{
OPT_Object obj = NIL;
OPS_Name name__copy;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPT__h
#define OPT__h
@ -15,9 +15,9 @@ typedef
typedef
struct OPT_ConstDesc {
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint64 setval;
INT64 intval;
INT32 intval2;
UINT64 setval;
LONGREAL realval;
} OPT_ConstDesc;
@ -33,7 +33,7 @@ typedef
typedef
struct OPT_NodeDesc {
OPT_Node left, right, link;
int8 class, subcl;
INT8 class, subcl;
BOOLEAN readonly;
OPT_Struct typ;
OPT_Object obj;
@ -45,20 +45,20 @@ typedef
OPT_Object left, right, link, scope;
OPS_Name name;
BOOLEAN leaf;
int8 mode, mnolev, vis, history;
INT8 mode, mnolev, vis, history;
BOOLEAN used, fpdone;
int32 fprint;
INT32 fprint;
OPT_Struct typ;
OPT_Const conval;
int32 adr, linkadr;
int16 x;
INT32 adr, linkadr;
INT16 x;
} OPT_ObjDesc;
typedef
struct OPT_StrDesc {
int8 form, comp, mno, extlev;
int16 ref, sysflag;
int32 n, size, align, txtpos;
INT8 form, comp, mno, extlev;
INT16 ref, sysflag;
INT32 n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused;
char _prvt0[16];
OPT_Struct BaseTyp;
@ -69,22 +69,22 @@ typedef
import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
import int8 OPT_nofGmod;
import INT8 OPT_nofGmod;
import OPT_Object OPT_GlbMod[64];
import OPS_Name OPT_SelfName;
import BOOLEAN OPT_SYSimported;
import address *OPT_ConstDesc__typ;
import address *OPT_ObjDesc__typ;
import address *OPT_StrDesc__typ;
import address *OPT_NodeDesc__typ;
import ADDRESS *OPT_ConstDesc__typ;
import ADDRESS *OPT_ObjDesc__typ;
import ADDRESS *OPT_StrDesc__typ;
import ADDRESS *OPT_NodeDesc__typ;
import void OPT_Align (int32 *adr, int32 base);
import int32 OPT_BaseAlignment (OPT_Struct typ);
import void OPT_Align (INT32 *adr, INT32 base);
import INT32 OPT_BaseAlignment (OPT_Struct typ);
import void OPT_Close (void);
import void OPT_CloseScope (void);
import void OPT_Export (BOOLEAN *ext, BOOLEAN *new);
import void OPT_FPrintErr (OPT_Object obj, int16 errcode);
import void OPT_FPrintErr (OPT_Object obj, INT16 errcode);
import void OPT_FPrintObj (OPT_Object obj);
import void OPT_FPrintStr (OPT_Struct typ);
import void OPT_Find (OPT_Object *res);
@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
import void OPT_FindImport (OPT_Object mod, OPT_Object *res);
import void OPT_IdFPrint (OPT_Struct typ);
import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
import void OPT_Init (OPS_Name name, uint32 opt);
import void OPT_Init (OPS_Name name, UINT32 opt);
import void OPT_InitRecno (void);
import void OPT_Insert (OPS_Name name, OPT_Object *obj);
import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
import int16 OPT_IntSize (int64 n);
import OPT_Struct OPT_IntType (int32 size);
import INT16 OPT_IntSize (INT64 n);
import OPT_Struct OPT_IntType (INT32 size);
import OPT_Const OPT_NewConst (void);
import OPT_ConstExt OPT_NewExt (void);
import OPT_Node OPT_NewNode (int8 class);
import OPT_Node OPT_NewNode (INT8 class);
import OPT_Object OPT_NewObj (void);
import OPT_Struct OPT_NewStr (int8 form, int8 comp);
import void OPT_OpenScope (int8 level, OPT_Object owner);
import OPT_Struct OPT_SetType (int32 size);
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
import int32 OPT_SizeAlignment (int32 size);
import OPT_Struct OPT_NewStr (INT8 form, INT8 comp);
import void OPT_OpenScope (INT8 level, OPT_Object owner);
import OPT_Struct OPT_SetType (INT32 size);
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir);
import INT32 OPT_SizeAlignment (INT32 size);
import void OPT_TypSize (OPT_Struct typ);
import void *OPT__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPC.h"
@ -13,42 +13,42 @@
typedef
struct OPV_ExitInfo {
int16 level, label;
INT16 level, label;
} OPV_ExitInfo;
static int16 OPV_stamp;
static INT16 OPV_stamp;
static OPV_ExitInfo OPV_exit;
static int16 OPV_nofExitLabels;
static INT16 OPV_nofExitLabels;
export address *OPV_ExitInfo__typ;
export ADDRESS *OPV_ExitInfo__typ;
static void OPV_ActualPar (OPT_Node n, OPT_Object fp);
export void OPV_AdrAndSize (OPT_Object topScope);
static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc);
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec);
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec);
static void OPV_DefineTDescs (OPT_Node n);
static void OPV_Entier (OPT_Node n, int16 prec);
static void OPV_Entier (OPT_Node n, INT16 prec);
static void OPV_GetTProcNum (OPT_Object obj);
static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc);
static BOOLEAN OPV_ImplicitReturn (OPT_Node n);
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim);
static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim);
export void OPV_Init (void);
static void OPV_InitTDescs (OPT_Node n);
static void OPV_Len (OPT_Node n, int64 dim);
static void OPV_Len (OPT_Node n, INT64 dim);
export void OPV_Module (OPT_Node prog);
static void OPV_NewArr (OPT_Node d, OPT_Node x);
static void OPV_ParIntLiteral (int64 n, int32 size);
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp);
static void OPV_ParIntLiteral (INT64 n, INT32 size);
static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp);
static BOOLEAN OPV_SideEffects (OPT_Node n);
static void OPV_SizeCast (OPT_Node n, int32 to);
static void OPV_SizeCast (OPT_Node n, INT32 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);
static void OPV_TraverseRecord (OPT_Struct typ);
static void OPV_TypeOf (OPT_Node n);
static void OPV_design (OPT_Node n, int16 prec);
static void OPV_expr (OPT_Node n, int16 prec);
static void OPV_design (OPT_Node n, INT16 prec);
static void OPV_expr (OPT_Node n, INT16 prec);
static void OPV_stat (OPT_Node n, OPT_Object outerProc);
@ -60,7 +60,7 @@ void OPV_Init (void)
static void OPV_GetTProcNum (OPT_Object obj)
{
int32 oldPos;
INT32 oldPos;
OPT_Struct typ = NIL;
OPT_Object redef = NIL;
oldPos = OPM_errpos;
@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ)
static void OPV_Stamp (OPS_Name s)
{
int16 i, j, k;
INT16 i, j, k;
CHAR n[10];
OPV_stamp += 1;
i = 0;
@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s)
static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported)
{
int16 mode;
INT16 mode;
OPT_Object scope = NIL;
OPT_Struct typ = NIL;
if (obj != NIL) {
@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
OPT_sysptrtyp->strobj->linkadr = 2;
}
static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp)
static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp)
{
switch (class) {
case 7: case 0: case 2: case 4: case 9:
@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp
__RETCHK;
}
static void OPV_Len (OPT_Node n, int64 dim)
static void OPV_Len (OPT_Node n, INT64 dim)
{
while ((n->class == 4 && n->typ->comp == 3)) {
dim += 1;
@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n)
__RETCHK;
}
static void OPV_Entier (OPT_Node n, int16 prec)
static void OPV_Entier (OPT_Node n, INT16 prec)
{
if (__IN(n->typ->form, 0x60, 32)) {
OPM_WriteString((CHAR*)"__ENTIER(", 10);
@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec)
}
}
static void OPV_SizeCast (OPT_Node n, int32 to)
static void OPV_SizeCast (OPT_Node n, INT32 to)
{
if ((to < n->typ->size && __IN(2, OPM_Options, 32))) {
OPM_WriteString((CHAR*)"__SHORT", 8);
@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to)
OPM_Write(')');
} else {
if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) {
OPM_WriteString((CHAR*)"(int", 5);
OPM_WriteString((CHAR*)"(INT", 5);
OPM_WriteInt(__ASHL(to, 3));
OPM_WriteString((CHAR*)")", 2);
}
}
}
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec)
static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec)
{
int16 from, to;
INT16 from, to;
from = n->typ->form;
to = newtype->form;
if (to == 7) {
@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n)
}
}
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim)
{
if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
OPV_expr(n->right, prec);
@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
}
}
static void OPV_design (OPT_Node n, int16 prec)
static void OPV_design (OPT_Node n, INT16 prec)
{
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
int16 class, designPrec, comp;
INT16 class, designPrec, comp;
OPT_Node d = NIL, x = NIL;
int16 dims, i, _for__26;
INT16 dims, i, _for__26;
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)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) {
if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) {
designPrec = 9;
}
if (prec > designPrec) {
@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec)
if (__IN(3, OPM_Options, 32)) {
if (typ->comp == 4) {
OPM_WriteString((CHAR*)"__GUARDR(", 10);
if ((int16)obj->mnolev != OPM_level) {
if ((INT16)obj->mnolev != OPM_level) {
OPM_WriteStringVar((void*)obj->scope->name, 256);
OPM_WriteString((CHAR*)"__curr->", 9);
OPC_Ident(obj);
@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec)
}
}
static void OPV_ParIntLiteral (int64 n, int32 size)
static void OPV_ParIntLiteral (INT64 n, INT32 size)
{
OPM_WriteInt(n);
}
@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size)
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
{
OPT_Struct typ = NIL, aptyp = NIL;
int16 comp, form, mode, prec, dim;
INT16 comp, form, mode, prec, dim;
OPM_Write('(');
while (n != NIL) {
typ = fp->typ;
@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n)
return obj;
}
static void OPV_expr (OPT_Node n, int16 prec)
static void OPV_expr (OPT_Node n, INT16 prec)
{
int16 class, subclass, form, exprPrec;
INT16 class, subclass, form, exprPrec;
OPT_Struct typ = NIL;
OPT_Node l = NIL, r = NIL;
OPT_Object proc = NIL;
@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc)
OPT_Node if_ = NIL;
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
int32 adr;
INT32 adr;
if_ = n->left;
while (if_ != NIL) {
OPM_WriteString((CHAR*)"if ", 4);
@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc)
static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc)
{
OPT_Node switchCase = NIL, label = NIL;
int64 low, high;
int16 form, i;
INT64 low, high;
INT16 form, i;
OPM_WriteString((CHAR*)"switch ", 8);
OPV_expr(n->left, 12);
OPM_Write(' ');
@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n)
static void OPV_NewArr (OPT_Node d, OPT_Node x)
{
OPT_Struct typ = NIL, base = NIL;
int16 nofdim, nofdyn;
INT16 nofdim, nofdyn;
typ = d->typ->BaseTyp;
base = typ;
nofdim = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,37 +1,37 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Platform.h"
static CHAR Out_buf[128];
static int16 Out_in;
static INT16 Out_in;
export void Out_Char (CHAR ch);
export void Out_Flush (void);
export void Out_Int (int64 x, int64 n);
static int32 Out_Length (CHAR *s, LONGINT s__len);
export void Out_Int (INT64 x, INT64 n);
static INT32 Out_Length (CHAR *s, LONGINT s__len);
export void Out_Ln (void);
export void Out_LongReal (LONGREAL x, int16 n);
export void Out_LongReal (LONGREAL x, INT16 n);
export void Out_Open (void);
export void Out_Real (REAL x, int16 n);
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_);
export void Out_Real (REAL x, INT16 n);
static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_);
export void Out_String (CHAR *str, LONGINT str__len);
export LONGREAL Out_Ten (int16 e);
static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i);
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i);
export LONGREAL Out_Ten (INT16 e);
static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i);
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i);
#define Out_Entier64(x) (int64)(x)
void Out_Flush (void)
{
int16 error;
INT16 error;
if (Out_in > 0) {
error = Platform_Write(1, (address)Out_buf, Out_in);
}
@ -54,9 +54,9 @@ void Out_Char (CHAR ch)
}
}
static int32 Out_Length (CHAR *s, LONGINT s__len)
static INT32 Out_Length (CHAR *s, LONGINT s__len)
{
int32 l;
INT32 l;
l = 0;
while ((l < s__len && s[__X(l, s__len)] != 0x00)) {
l += 1;
@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len)
void Out_String (CHAR *str, LONGINT str__len)
{
int32 l;
int16 error;
INT32 l;
INT16 error;
__DUP(str, str__len, CHAR);
l = Out_Length((void*)str, str__len);
if (Out_in + l > 128) {
@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len)
error = Platform_Write(1, (address)str, l);
} else {
__MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l);
Out_in += (int16)l;
Out_in += (INT16)l;
}
__DEL(str);
}
void Out_Int (int64 x, int64 n)
void Out_Int (INT64 x, INT64 n)
{
CHAR s[22];
int16 i;
INT16 i;
BOOLEAN negative;
negative = x < 0;
if (x == (-9223372036854775807-1)) {
@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n)
s[__X(i, 22)] = '-';
i += 1;
}
while (n > (int64)i) {
while (n > (INT64)i) {
Out_Char(' ');
n -= 1;
}
@ -124,22 +124,22 @@ void Out_Ln (void)
Out_Flush();
}
static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i)
static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i)
{
*i -= 1;
s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48);
}
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i)
static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i)
{
int16 j;
int32 l;
INT16 j;
INT32 l;
__DUP(t, t__len, CHAR);
l = Out_Length((void*)t, t__len);
if (l > *i) {
l = *i;
}
*i -= (int16)l;
*i -= (INT16)l;
j = 0;
while (j < l) {
s[__X(*i + j, s__len)] = t[__X(j, t__len)];
@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16
__DEL(t);
}
LONGREAL Out_Ten (int16 e)
LONGREAL Out_Ten (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e)
return r;
}
static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_)
{
int16 e;
int64 f;
INT16 e;
INT64 f;
CHAR s[30];
int16 i, el;
INT16 i, el;
LONGREAL x0;
BOOLEAN nn, en;
int64 m;
int16 d, dr;
e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048);
f = __MASK((__VAL(int64, x)), -4503599627370496);
nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0)));
INT64 m;
INT16 d, dr;
e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048);
f = __MASK((__VAL(INT64, x)), -4503599627370496);
nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0)));
if (nn) {
n -= 1;
}
@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
if (nn) {
x = -x;
}
e = (int16)__ASHR((e - 1023) * 77, 8);
e = (INT16)__ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Out_Ten(e);
} else {
@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_)
}
}
void Out_Real (REAL x, int16 n)
void Out_Real (REAL x, INT16 n)
{
Out_RealP(x, n, 0);
}
void Out_LongReal (LONGREAL x, int16 n)
void Out_LongReal (LONGREAL x, INT16 n)
{
Out_RealP(x, n, 1);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Out__h
#define Out__h
@ -10,13 +10,13 @@
import void Out_Char (CHAR ch);
import void Out_Flush (void);
import void Out_Int (int64 x, int64 n);
import void Out_Int (INT64 x, INT64 n);
import void Out_Ln (void);
import void Out_LongReal (LONGREAL x, int16 n);
import void Out_LongReal (LONGREAL x, INT16 n);
import void Out_Open (void);
import void Out_Real (REAL x, int16 n);
import void Out_Real (REAL x, INT16 n);
import void Out_String (CHAR *str, LONGINT str__len);
import LONGREAL Out_Ten (int16 e);
import LONGREAL Out_Ten (INT16 e);
import void *Out__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -14,92 +14,92 @@ typedef
Platform_ArgPtr (*Platform_ArgVec)[1024];
typedef
int32 (*Platform_ArgVecPtr)[1];
INT32 (*Platform_ArgVecPtr)[1];
typedef
CHAR (*Platform_EnvPtr)[1024];
typedef
struct Platform_FileIdentity {
int32 volume, index, mtime;
INT32 volume, index, mtime;
} Platform_FileIdentity;
typedef
void (*Platform_HaltProcedure)(int32);
void (*Platform_HaltProcedure)(INT32);
typedef
void (*Platform_SignalHandler)(int32);
void (*Platform_SignalHandler)(INT32);
export BOOLEAN Platform_LittleEndian;
export int32 Platform_MainStackFrame;
export int32 Platform_HaltCode;
export int16 Platform_PID;
export INT32 Platform_MainStackFrame;
export INT32 Platform_HaltCode;
export INT16 Platform_PID;
export CHAR Platform_CWD[256];
export int16 Platform_ArgCount;
export int32 Platform_ArgVector;
export INT16 Platform_ArgCount;
export INT32 Platform_ArgVector;
static Platform_HaltProcedure Platform_HaltHandler;
static int32 Platform_TimeStart;
export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
static INT32 Platform_TimeStart;
export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
export CHAR Platform_NL[3];
export address *Platform_FileIdentity__typ;
export ADDRESS *Platform_FileIdentity__typ;
export BOOLEAN Platform_Absent (int16 e);
export int16 Platform_ArgPos (CHAR *s, LONGINT s__len);
export void Platform_AssertFail (int32 code);
export int16 Platform_Chdir (CHAR *n, LONGINT n__len);
export int16 Platform_Close (int32 h);
export BOOLEAN Platform_ConnectionFailed (int16 e);
export void Platform_Delay (int32 ms);
export BOOLEAN Platform_DifferentFilesystems (int16 e);
static void Platform_DisplayHaltCode (int32 code);
export int16 Platform_Error (void);
export void Platform_Exit (int16 code);
export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len);
export void Platform_GetClock (int32 *t, int32 *d);
export BOOLEAN Platform_Absent (INT16 e);
export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
export void Platform_AssertFail (INT32 code);
export INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
export INT16 Platform_Close (INT32 h);
export BOOLEAN Platform_ConnectionFailed (INT16 e);
export void Platform_Delay (INT32 ms);
export BOOLEAN Platform_DifferentFilesystems (INT16 e);
static void Platform_DisplayHaltCode (INT32 code);
export INT16 Platform_Error (void);
export void Platform_Exit (INT16 code);
export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
export void Platform_GetClock (INT32 *t, INT32 *d);
export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
export void Platform_GetIntArg (int16 n, int32 *val);
export void Platform_GetTimeOfDay (int32 *sec, int32 *usec);
export void Platform_Halt (int32 code);
export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ);
export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ);
export BOOLEAN Platform_Inaccessible (int16 e);
export void Platform_Init (int32 argc, int32 argvadr);
export BOOLEAN Platform_Interrupted (int16 e);
export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d);
export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h);
export BOOLEAN Platform_NoSuchDirectory (int16 e);
export int32 Platform_OSAllocate (int32 size);
export void Platform_OSFree (int32 address);
export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h);
export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h);
export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n);
export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n);
export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
export void Platform_GetIntArg (INT16 n, INT32 *val);
export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
export void Platform_Halt (INT32 code);
export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export BOOLEAN Platform_Inaccessible (INT16 e);
export void Platform_Init (INT32 argc, INT32 argvadr);
export BOOLEAN Platform_Interrupted (INT16 e);
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
export INT32 Platform_OSAllocate (INT32 size);
export void Platform_OSFree (INT32 address);
export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h);
export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h);
export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n);
export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n);
export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2);
export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
export int16 Platform_Seek (int32 h, int32 offset, int16 whence);
export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence);
export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetInterruptHandler (Platform_SignalHandler handler);
export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source);
export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
export void Platform_SetQuitHandler (Platform_SignalHandler handler);
export int16 Platform_Size (int32 h, int32 *l);
export int16 Platform_Sync (int32 h);
export int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
export INT16 Platform_Size (INT32 h, INT32 *l);
export INT16 Platform_Sync (INT32 h);
export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len);
static void Platform_TestLittleEndian (void);
export int32 Platform_Time (void);
export BOOLEAN Platform_TimedOut (int16 e);
export BOOLEAN Platform_TooManyFiles (int16 e);
export int16 Platform_Truncate (int32 h, int32 l);
export int16 Platform_Unlink (CHAR *n, LONGINT n__len);
export int16 Platform_Write (int32 h, int32 p, int32 l);
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d);
export INT32 Platform_Time (void);
export BOOLEAN Platform_TimedOut (INT16 e);
export BOOLEAN Platform_TooManyFiles (INT16 e);
export INT16 Platform_Truncate (INT32 h, INT32 l);
export INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
export INT16 Platform_Write (INT32 h, INT32 p, INT32 l);
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d);
static void Platform_errch (CHAR c);
static void Platform_errint (int32 l);
static void Platform_errint (INT32 l);
static void Platform_errln (void);
static void Platform_errposint (int32 l);
static void Platform_errposint (INT32 l);
export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
#include <errno.h>
@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
#define Platform_EXDEV() EXDEV
extern void Heap_InitHeap();
#define Platform_HeapInitHeap() Heap_InitHeap()
#define Platform_allocate(size) (address)((void*)malloc((size_t)size))
#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size))
#define Platform_chdir(n, n__len) chdir((char*)n)
#define Platform_closefile(fd) close(fd)
#define Platform_err() errno
@ -147,13 +147,13 @@ extern void Heap_InitHeap();
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
#define Platform_openro(n, n__len) open((char*)n, O_RDONLY)
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l)
#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l)
#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n)
#define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s)
#define Platform_seekcur() SEEK_CUR
#define Platform_seekend() SEEK_END
#define Platform_seekset() SEEK_SET
#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h)
#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h)
#define Platform_stat(n, n__len) stat((char*)n, &s)
#define Platform_statdev() (LONGINT)s.st_dev
#define Platform_statino() (LONGINT)s.st_ino
@ -170,63 +170,63 @@ extern void Heap_InitHeap();
#define Platform_tvsec() tv.tv_sec
#define Platform_tvusec() tv.tv_usec
#define Platform_unlink(n, n__len) unlink((char*)n)
#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l)
#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l)
BOOLEAN Platform_TooManyFiles (int16 e)
BOOLEAN Platform_TooManyFiles (INT16 e)
{
return e == Platform_EMFILE() || e == Platform_ENFILE();
}
BOOLEAN Platform_NoSuchDirectory (int16 e)
BOOLEAN Platform_NoSuchDirectory (INT16 e)
{
return e == Platform_ENOENT();
}
BOOLEAN Platform_DifferentFilesystems (int16 e)
BOOLEAN Platform_DifferentFilesystems (INT16 e)
{
return e == Platform_EXDEV();
}
BOOLEAN Platform_Inaccessible (int16 e)
BOOLEAN Platform_Inaccessible (INT16 e)
{
return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN();
}
BOOLEAN Platform_Absent (int16 e)
BOOLEAN Platform_Absent (INT16 e)
{
return e == Platform_ENOENT();
}
BOOLEAN Platform_TimedOut (int16 e)
BOOLEAN Platform_TimedOut (INT16 e)
{
return e == Platform_ETIMEDOUT();
}
BOOLEAN Platform_ConnectionFailed (int16 e)
BOOLEAN Platform_ConnectionFailed (INT16 e)
{
return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH();
}
BOOLEAN Platform_Interrupted (int16 e)
BOOLEAN Platform_Interrupted (INT16 e)
{
return e == Platform_EINTR();
}
int32 Platform_OSAllocate (int32 size)
INT32 Platform_OSAllocate (INT32 size)
{
return Platform_allocate(size);
}
void Platform_OSFree (int32 address)
void Platform_OSFree (INT32 address)
{
Platform_free(address);
}
void Platform_Init (int32 argc, int32 argvadr)
void Platform_Init (INT32 argc, INT32 argvadr)
{
Platform_ArgVecPtr av = NIL;
Platform_MainStackFrame = argvadr;
Platform_ArgCount = __VAL(int16, argc);
Platform_ArgCount = __VAL(INT16, argc);
av = (Platform_ArgVecPtr)(address)argvadr;
Platform_ArgVector = (*av)[0];
Platform_HaltCode = -128;
@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len)
__DEL(var);
}
void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len)
{
Platform_ArgVec av = NIL;
if (n < Platform_ArgCount) {
@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len)
}
}
void Platform_GetIntArg (int16 n, int32 *val)
void Platform_GetIntArg (INT16 n, INT32 *val)
{
CHAR s[64];
int32 k, d, i;
INT32 k, d, i;
s[0] = 0x00;
Platform_GetArg(n, (void*)s, 64);
i = 0;
@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val)
i = 1;
}
k = 0;
d = (int16)s[__X(i, 64)] - 48;
d = (INT16)s[__X(i, 64)] - 48;
while ((d >= 0 && d <= 9)) {
k = k * 10 + d;
i += 1;
d = (int16)s[__X(i, 64)] - 48;
d = (INT16)s[__X(i, 64)] - 48;
}
if (s[0] == '-') {
k = -k;
@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val)
}
}
int16 Platform_ArgPos (CHAR *s, LONGINT s__len)
INT16 Platform_ArgPos (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
CHAR arg[256];
__DUP(s, s__len, CHAR);
i = 0;
@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
Platform_sethandler(4, handler);
}
static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d)
static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d)
{
*d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se;
}
void Platform_GetClock (int32 *t, int32 *d)
void Platform_GetClock (INT32 *t, INT32 *d)
{
Platform_gettimeval();
Platform_sectotm(Platform_tvsec());
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
}
void Platform_GetTimeOfDay (int32 *sec, int32 *usec)
void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec)
{
Platform_gettimeval();
*sec = Platform_tvsec();
*usec = Platform_tvusec();
}
int32 Platform_Time (void)
INT32 Platform_Time (void)
{
int32 ms;
INT32 ms;
Platform_gettimeval();
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
return (int)__MOD(ms - Platform_TimeStart, 2147483647);
}
void Platform_Delay (int32 ms)
void Platform_Delay (INT32 ms)
{
int32 s, ns;
INT32 s, ns;
s = __DIV(ms, 1000);
ns = (int)__MOD(ms, 1000) * 1000000;
Platform_nanosleep(s, ns);
}
int16 Platform_System (CHAR *cmd, LONGINT cmd__len)
INT16 Platform_System (CHAR *cmd, LONGINT cmd__len)
{
__DUP(cmd, cmd__len, CHAR);
__DEL(cmd);
return Platform_system(cmd, cmd__len);
}
int16 Platform_Error (void)
INT16 Platform_Error (void)
{
return Platform_err();
}
int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_openro(n, n__len);
if (fd < 0) {
return Platform_err();
@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_openrw(n, n__len);
if (fd < 0) {
return Platform_err();
@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h)
{
int16 fd;
INT16 fd;
fd = Platform_opennew(n, n__len);
if (fd < 0) {
return Platform_err();
@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h)
__RETCHK;
}
int16 Platform_Close (int32 h)
INT16 Platform_Close (INT32 h)
{
if (Platform_closefile(h) < 0) {
return Platform_err();
@ -416,7 +416,7 @@ int16 Platform_Close (int32 h)
__RETCHK;
}
int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ)
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
{
Platform_structstats();
if (Platform_fstat(h) < 0) {
@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden
return 0;
}
int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ)
INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ)
{
__DUP(n, n__len, CHAR);
Platform_structstats();
@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i
return i1.mtime == i2.mtime;
}
void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source)
void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source)
{
(*target).mtime = source.mtime;
}
void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d)
void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d)
{
Platform_sectotm(i.mtime);
Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d);
}
int16 Platform_Size (int32 h, int32 *l)
INT16 Platform_Size (INT32 h, INT32 *l)
{
Platform_structstats();
if (Platform_fstat(h) < 0) {
@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l)
return 0;
}
int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n)
{
*n = Platform_readfile(h, p, l);
if (*n < 0) {
@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n)
__RETCHK;
}
int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n)
{
*n = Platform_readfile(h, (address)b, b__len);
if (*n < 0) {
@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n)
__RETCHK;
}
int16 Platform_Write (int32 h, int32 p, int32 l)
INT16 Platform_Write (INT32 h, INT32 p, INT32 l)
{
int32 written;
INT32 written;
written = Platform_writefile(h, p, l);
if (written < 0) {
return Platform_err();
@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l)
__RETCHK;
}
int16 Platform_Sync (int32 h)
INT16 Platform_Sync (INT32 h)
{
if (Platform_fsync(h) < 0) {
return Platform_err();
@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h)
__RETCHK;
}
int16 Platform_Seek (int32 h, int32 offset, int16 whence)
INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence)
{
if (Platform_lseek(h, offset, whence) < 0) {
return Platform_err();
@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence)
__RETCHK;
}
int16 Platform_Truncate (int32 h, int32 l)
INT16 Platform_Truncate (INT32 h, INT32 l)
{
if (Platform_ftruncate(h, l) < 0) {
return Platform_err();
@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l)
__RETCHK;
}
int16 Platform_Unlink (CHAR *n, LONGINT n__len)
INT16 Platform_Unlink (CHAR *n, LONGINT n__len)
{
if (Platform_unlink(n, n__len) < 0) {
return Platform_err();
@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len)
__RETCHK;
}
int16 Platform_Chdir (CHAR *n, LONGINT n__len)
INT16 Platform_Chdir (CHAR *n, LONGINT n__len)
{
int16 r;
INT16 r;
if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) {
return 0;
} else {
@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len)
__RETCHK;
}
int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
{
if (Platform_rename(o, o__len, n, n__len) < 0) {
return Platform_err();
@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
__RETCHK;
}
void Platform_Exit (int16 code)
void Platform_Exit (INT16 code)
{
Platform_exit(code);
}
@ -586,7 +586,7 @@ static void Platform_errln (void)
Platform_errch(0x0a);
}
static void Platform_errposint (int32 l)
static void Platform_errposint (INT32 l)
{
if (l > 10) {
Platform_errposint(__DIV(l, 10));
@ -594,7 +594,7 @@ static void Platform_errposint (int32 l)
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
static void Platform_errint (int32 l)
static void Platform_errint (INT32 l)
{
if (l < 0) {
Platform_errch('-');
@ -603,7 +603,7 @@ static void Platform_errint (int32 l)
Platform_errposint(l);
}
static void Platform_DisplayHaltCode (int32 code)
static void Platform_DisplayHaltCode (INT32 code)
{
switch (code) {
case -1:
@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code)
}
}
void Platform_Halt (int32 code)
void Platform_Halt (INT32 code)
{
Platform_HaltCode = code;
if (Platform_HaltHandler != NIL) {
@ -672,10 +672,10 @@ void Platform_Halt (int32 code)
Platform_DisplayHaltCode(code);
}
Platform_errln();
Platform_exit(__VAL(int16, code));
Platform_exit(__VAL(INT16, code));
}
void Platform_AssertFail (int32 code)
void Platform_AssertFail (INT32 code)
{
Platform_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code)
Platform_errstring((CHAR*)".", 2);
}
Platform_errln();
Platform_exit(__VAL(int16, code));
Platform_exit(__VAL(INT16, code));
}
void Platform_SetHalt (Platform_HaltProcedure p)
@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p)
static void Platform_TestLittleEndian (void)
{
int16 i;
INT16 i;
i = 1;
__GET((address)&i, Platform_LittleEndian, BOOLEAN);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Platform__h
#define Platform__h
@ -7,77 +7,77 @@
typedef
struct Platform_FileIdentity {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[8];
} Platform_FileIdentity;
typedef
void (*Platform_HaltProcedure)(int32);
void (*Platform_HaltProcedure)(INT32);
typedef
void (*Platform_SignalHandler)(int32);
void (*Platform_SignalHandler)(INT32);
import BOOLEAN Platform_LittleEndian;
import int32 Platform_MainStackFrame;
import int32 Platform_HaltCode;
import int16 Platform_PID;
import INT32 Platform_MainStackFrame;
import INT32 Platform_HaltCode;
import INT16 Platform_PID;
import CHAR Platform_CWD[256];
import int16 Platform_ArgCount;
import int32 Platform_ArgVector;
import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
import INT16 Platform_ArgCount;
import INT32 Platform_ArgVector;
import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
import CHAR Platform_NL[3];
import address *Platform_FileIdentity__typ;
import ADDRESS *Platform_FileIdentity__typ;
import BOOLEAN Platform_Absent (int16 e);
import int16 Platform_ArgPos (CHAR *s, LONGINT s__len);
import void Platform_AssertFail (int32 code);
import int16 Platform_Chdir (CHAR *n, LONGINT n__len);
import int16 Platform_Close (int32 h);
import BOOLEAN Platform_ConnectionFailed (int16 e);
import void Platform_Delay (int32 ms);
import BOOLEAN Platform_DifferentFilesystems (int16 e);
import int16 Platform_Error (void);
import void Platform_Exit (int16 code);
import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len);
import void Platform_GetClock (int32 *t, int32 *d);
import BOOLEAN Platform_Absent (INT16 e);
import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
import void Platform_AssertFail (INT32 code);
import INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
import INT16 Platform_Close (INT32 h);
import BOOLEAN Platform_ConnectionFailed (INT16 e);
import void Platform_Delay (INT32 ms);
import BOOLEAN Platform_DifferentFilesystems (INT16 e);
import INT16 Platform_Error (void);
import void Platform_Exit (INT16 code);
import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
import void Platform_GetClock (INT32 *t, INT32 *d);
import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void Platform_GetIntArg (int16 n, int32 *val);
import void Platform_GetTimeOfDay (int32 *sec, int32 *usec);
import void Platform_Halt (int32 code);
import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ);
import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ);
import BOOLEAN Platform_Inaccessible (int16 e);
import void Platform_Init (int32 argc, int32 argvadr);
import BOOLEAN Platform_Interrupted (int16 e);
import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d);
import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h);
import BOOLEAN Platform_NoSuchDirectory (int16 e);
import int32 Platform_OSAllocate (int32 size);
import void Platform_OSFree (int32 address);
import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h);
import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h);
import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n);
import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n);
import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
import void Platform_GetIntArg (INT16 n, INT32 *val);
import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
import void Platform_Halt (INT32 code);
import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import BOOLEAN Platform_Inaccessible (INT16 e);
import void Platform_Init (INT32 argc, INT32 argvadr);
import BOOLEAN Platform_Interrupted (INT16 e);
import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
import BOOLEAN Platform_NoSuchDirectory (INT16 e);
import INT32 Platform_OSAllocate (INT32 size);
import void Platform_OSFree (INT32 address);
import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h);
import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h);
import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n);
import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n);
import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len);
import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2);
import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
import int16 Platform_Seek (int32 h, int32 offset, int16 whence);
import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence);
import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetInterruptHandler (Platform_SignalHandler handler);
import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source);
import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
import void Platform_SetQuitHandler (Platform_SignalHandler handler);
import int16 Platform_Size (int32 h, int32 *l);
import int16 Platform_Sync (int32 h);
import int16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import int32 Platform_Time (void);
import BOOLEAN Platform_TimedOut (int16 e);
import BOOLEAN Platform_TooManyFiles (int16 e);
import int16 Platform_Truncate (int32 h, int32 l);
import int16 Platform_Unlink (CHAR *n, LONGINT n__len);
import int16 Platform_Write (int32 h, int32 p, int32 l);
import INT16 Platform_Size (INT32 h, INT32 *l);
import INT16 Platform_Sync (INT32 h);
import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len);
import INT32 Platform_Time (void);
import BOOLEAN Platform_TimedOut (INT16 e);
import BOOLEAN Platform_TooManyFiles (INT16 e);
import INT16 Platform_Truncate (INT32 h, INT32 l);
import INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
import INT16 Platform_Write (INT32 h, INT32 p, INT32 l);
import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void *Platform__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -11,19 +11,19 @@
static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len);
export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len);
export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len);
export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len);
export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len);
export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len);
export int16 Reals_Expo (REAL x);
export int16 Reals_ExpoL (LONGREAL x);
export void Reals_SetExpo (REAL *x, int16 ex);
export REAL Reals_Ten (int16 e);
export LONGREAL Reals_TenL (int16 e);
static CHAR Reals_ToHex (int16 i);
export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len);
export INT16 Reals_Expo (REAL x);
export INT16 Reals_ExpoL (LONGREAL x);
export void Reals_SetExpo (REAL *x, INT16 ex);
export REAL Reals_Ten (INT16 e);
export LONGREAL Reals_TenL (INT16 e);
static CHAR Reals_ToHex (INT16 i);
REAL Reals_Ten (int16 e)
REAL Reals_Ten (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e)
return r;
}
LONGREAL Reals_TenL (int16 e)
LONGREAL Reals_TenL (INT16 e)
{
LONGREAL r, power;
r = (LONGREAL)1;
@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e)
__RETCHK;
}
int16 Reals_Expo (REAL x)
INT16 Reals_Expo (REAL x)
{
int16 i;
__GET((address)&x + 2, i, int16);
INT16 i;
__GET((address)&x + 2, i, INT16);
return __MASK(__ASHR(i, 7), -256);
}
void Reals_SetExpo (REAL *x, int16 ex)
void Reals_SetExpo (REAL *x, INT16 ex)
{
CHAR c;
__GET((address)x + 3, c, CHAR);
__PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((address)x + 2, c, CHAR);
__PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
__PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
}
int16 Reals_ExpoL (LONGREAL x)
INT16 Reals_ExpoL (LONGREAL x)
{
int16 i;
__GET((address)&x + 6, i, int16);
INT16 i;
__GET((address)&x + 6, i, INT16);
return __MASK(__ASHR(i, 4), -2048);
}
void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len)
{
int32 i, j, k;
INT32 i, j, k;
if (x < (LONGREAL)0) {
x = -x;
}
k = 0;
if (n > 9) {
i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (int32)__ENTIER(x - i * (LONGREAL)1000000000);
i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000);
if (j < 0) {
j = 0;
}
@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
k += 1;
}
} else {
i = (int32)__ENTIER(x);
i = (INT32)__ENTIER(x);
}
while (k < n) {
d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len)
}
}
void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len)
void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len)
{
Reals_ConvertL(x, n, (void*)d, d__len);
}
static CHAR Reals_ToHex (int16 i)
static CHAR Reals_ToHex (INT16 i)
{
if (i < 10) {
return (CHAR)(i + 48);
@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i)
static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len)
{
int16 i;
int32 l;
INT16 i;
INT32 l;
CHAR by;
i = 0;
l = b__len;
while (i < l) {
by = __VAL(CHAR, b[__X(i, b__len)]);
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16));
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16));
i += 1;
}
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Reals__h
#define Reals__h
@ -8,15 +8,15 @@
import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len);
import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len);
import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len);
import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len);
import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len);
import int16 Reals_Expo (REAL x);
import int16 Reals_ExpoL (LONGREAL x);
import void Reals_SetExpo (REAL *x, int16 ex);
import REAL Reals_Ten (int16 e);
import LONGREAL Reals_TenL (int16 e);
import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len);
import INT16 Reals_Expo (REAL x);
import INT16 Reals_ExpoL (LONGREAL x);
import void Reals_SetExpo (REAL *x, INT16 ex);
import REAL Reals_Ten (INT16 e);
import LONGREAL Reals_TenL (INT16 e);
import void *Reals__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -12,18 +12,18 @@
export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len);
export void Strings_Cap (CHAR *s, LONGINT s__len);
export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n);
export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len);
export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
export int16 Strings_Length (CHAR *s, LONGINT s__len);
export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n);
export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len);
export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
export INT16 Strings_Length (CHAR *s, LONGINT s__len);
export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len);
export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos);
export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos);
export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
int16 Strings_Length (CHAR *s, LONGINT s__len)
INT16 Strings_Length (CHAR *s, LONGINT s__len)
{
int32 i;
INT32 i;
__DUP(s, s__len, CHAR);
i = 0;
while ((i < s__len && s[__X(i, s__len)] != 0x00)) {
@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
}
if (i <= 32767) {
__DEL(s);
return (int16)i;
return (INT16)i;
} else {
__DEL(s);
return 32767;
@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len)
void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len)
{
int16 n1, n2, i;
INT16 n1, n2, i;
__DUP(extra, extra__len, CHAR);
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(extra, extra__len);
@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__
__DEL(extra);
}
void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len)
void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len)
{
int16 n1, n2, i;
INT16 n1, n2, i;
__DUP(source, source__len, CHAR);
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(source, source__len);
@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L
__DEL(source);
}
void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n)
void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n)
{
int16 len, i;
INT16 len, i;
len = Strings_Length(s, s__len);
if (pos < 0) {
pos = 0;
@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n)
}
}
void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len)
void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len)
{
__DUP(source, source__len, CHAR);
Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len));
@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest,
__DEL(source);
}
void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len)
void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len)
{
int16 len, destLen, i;
INT16 len, destLen, i;
__DUP(source, source__len, CHAR);
len = Strings_Length(source, source__len);
destLen = (int16)dest__len - 1;
destLen = (INT16)dest__len - 1;
if (pos < 0) {
pos = 0;
}
@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA
__DEL(source);
}
int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos)
INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos)
{
int16 n1, n2, i, j;
INT16 n1, n2, i, j;
__DUP(pattern, pattern__len, CHAR);
__DUP(s, s__len, CHAR);
n1 = Strings_Length(s, s__len);
@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len,
void Strings_Cap (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) {
@ -191,9 +191,9 @@ static struct Match__7 {
struct Match__7 *lnk;
} *Match__7_s;
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m);
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m);
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m)
static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m)
{
while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) {
if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Strings__h
#define Strings__h
@ -10,13 +10,13 @@
import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len);
import void Strings_Cap (CHAR *s, LONGINT s__len);
import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n);
import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len);
import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
import int16 Strings_Length (CHAR *s, LONGINT s__len);
import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n);
import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len);
import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
import INT16 Strings_Length (CHAR *s, LONGINT s__len);
import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len);
import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos);
import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len);
import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos);
import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len);
import void *Strings__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Files.h"
@ -19,9 +19,9 @@ typedef
typedef
struct Texts_RunDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
} Texts_RunDesc;
@ -34,7 +34,7 @@ typedef
} Texts_ElemMsg;
typedef
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *);
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *);
typedef
struct Texts_TextDesc *Texts_Text;
@ -42,26 +42,26 @@ typedef
typedef
struct Texts_ElemDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
int32 W, H;
INT32 W, H;
Texts_Handler handle;
Texts_Text base;
} Texts_ElemDesc;
struct Texts__1 { /* Texts_ElemDesc */
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
int32 W, H;
INT32 W, H;
Texts_Handler handle;
Texts_Text base;
Files_File file;
int32 org, span;
INT32 org, span;
CHAR mod[32], proc[32];
};
@ -70,7 +70,7 @@ typedef
typedef
struct Texts_BufDesc {
int32 len;
INT32 len;
Texts_Run head;
} Texts_BufDesc;
@ -84,8 +84,8 @@ typedef
typedef
struct Texts_FileMsg { /* Texts_ElemMsg */
int16 id;
int32 pos;
INT16 id;
INT32 pos;
Files_Rider r;
} Texts_FileMsg;
@ -100,7 +100,7 @@ typedef
} Texts_IdentifyMsg;
typedef
void (*Texts_Notifier)(Texts_Text, int16, int32, int32);
void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32);
typedef
struct Texts_PieceDesc *Texts_Piece;
@ -108,57 +108,57 @@ typedef
typedef
struct Texts_PieceDesc {
Texts_Run prev, next;
int32 len;
INT32 len;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
BOOLEAN ascii;
Files_File file;
int32 org;
INT32 org;
} Texts_PieceDesc;
typedef
struct Texts_Reader {
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
Files_Rider rider;
Texts_Run run;
int32 org, off;
INT32 org, off;
} Texts_Reader;
typedef
struct Texts_Scanner { /* Texts_Reader */
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
Files_Rider rider;
Texts_Run run;
int32 org, off;
INT32 org, off;
CHAR nextCh;
int16 line, class;
int32 i;
INT16 line, class;
INT32 i;
REAL x;
LONGREAL y;
CHAR c;
int8 len;
INT8 len;
CHAR s[64];
} Texts_Scanner;
typedef
struct Texts_TextDesc {
int32 len;
INT32 len;
Texts_Notifier notify;
Texts_Run head, cache;
int32 corg;
INT32 corg;
} Texts_TextDesc;
typedef
struct Texts_Writer {
Texts_Buffer buf;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Files_Rider rider;
Files_File file;
} Texts_Writer;
@ -168,68 +168,68 @@ export Texts_Elem Texts_new;
static Texts_Buffer Texts_del;
static Texts_FontsFont Texts_FontsDefault;
export address *Texts_FontDesc__typ;
export address *Texts_RunDesc__typ;
export address *Texts_PieceDesc__typ;
export address *Texts_ElemMsg__typ;
export address *Texts_ElemDesc__typ;
export address *Texts_FileMsg__typ;
export address *Texts_CopyMsg__typ;
export address *Texts_IdentifyMsg__typ;
export address *Texts_BufDesc__typ;
export address *Texts_TextDesc__typ;
export address *Texts_Reader__typ;
export address *Texts_Scanner__typ;
export address *Texts_Writer__typ;
export address *Texts__1__typ;
export ADDRESS *Texts_FontDesc__typ;
export ADDRESS *Texts_RunDesc__typ;
export ADDRESS *Texts_PieceDesc__typ;
export ADDRESS *Texts_ElemMsg__typ;
export ADDRESS *Texts_ElemDesc__typ;
export ADDRESS *Texts_FileMsg__typ;
export ADDRESS *Texts_CopyMsg__typ;
export ADDRESS *Texts_IdentifyMsg__typ;
export ADDRESS *Texts_BufDesc__typ;
export ADDRESS *Texts_TextDesc__typ;
export ADDRESS *Texts_Reader__typ;
export ADDRESS *Texts_Scanner__typ;
export ADDRESS *Texts_Writer__typ;
export ADDRESS *Texts__1__typ;
export void Texts_Append (Texts_Text T, Texts_Buffer B);
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff);
static Texts_Elem Texts_CloneElem (Texts_Elem e);
static Texts_Piece Texts_ClonePiece (Texts_Piece p);
export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
export void Texts_Delete (Texts_Text T, int32 beg, int32 end);
export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
export Texts_Text Texts_ElemBase (Texts_Elem E);
export int32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off);
export INT32 Texts_ElemPos (Texts_Elem E);
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off);
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len);
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ);
export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B);
export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T);
static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T);
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ);
export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);
export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v);
export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len);
export void Texts_OpenBuf (Texts_Buffer B);
export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos);
export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos);
export void Texts_OpenWriter (Texts_Writer *W, address *W__typ);
export int32 Texts_Pos (Texts_Reader *R, address *R__typ);
export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch);
export void Texts_ReadElem (Texts_Reader *R, address *R__typ);
export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ);
export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos);
export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos);
export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ);
export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch);
export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ);
export void Texts_Recall (Texts_Buffer *B);
export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B);
export void Texts_Scan (Texts_Scanner *S, address *S__typ);
export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col);
export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt);
export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff);
export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B);
export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ);
export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col);
export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt);
export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff);
static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base);
static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un);
export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T);
export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch);
export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d);
export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e);
export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x);
export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n);
export void Texts_WriteLn (Texts_Writer *W, address *W__typ);
export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n);
export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x);
export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n);
export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k);
export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len);
static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un);
export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch);
export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d);
export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e);
export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x);
export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n);
export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ);
export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n);
export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x);
export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n);
export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k);
export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len);
static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
return F;
}
static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off)
static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off)
{
Texts_Run v = NIL;
int32 m;
INT32 m;
if (*pos >= T->len) {
*pos = T->len;
*u = T->head;
@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3
}
}
static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un)
static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un)
{
Texts_Piece p = NIL, U = NIL;
if (off == 0) {
@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E)
return E->base;
}
int32 Texts_ElemPos (Texts_Elem E)
INT32 Texts_ElemPos (Texts_Elem E)
{
Texts_Run u = NIL;
int32 pos;
INT32 pos;
u = E->base->head->next;
pos = 0;
while (u != (void *) E) {
@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E)
return pos;
}
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ)
static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ)
{
Texts_Alien e = NIL;
Files_Rider r;
int32 i;
INT32 i;
CHAR ch;
if (__ISP(E, Texts__1, 2)) {
if (__IS(msg__typ, Texts_CopyMsg, 1)) {
@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B)
Texts_del = NIL;
}
void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B)
void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B)
{
Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL;
int32 uo, ud, vo, vd;
INT32 uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Find(T, &end, &v, &vo, &vd);
w = B->head->prev;
@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B)
B->len += end - beg;
}
void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B)
void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B)
{
Texts_Run u = NIL, un = NIL, v = NIL;
Texts_Piece p = NIL, q = NIL;
int32 uo, ud, len;
INT32 uo, ud, len;
Texts_Find(T, &pos, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
len = B->len;
@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B)
void Texts_Append (Texts_Text T, Texts_Buffer B)
{
Texts_Run v = NIL;
int32 pos, len;
INT32 pos, len;
pos = T->len;
len = B->len;
v = B->head->next;
@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B)
}
}
void Texts_Delete (Texts_Text T, int32 beg, int32 end)
void Texts_Delete (Texts_Text T, INT32 beg, INT32 end)
{
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
int32 co, uo, ud, vo, vd;
INT32 co, uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
c = T->cache;
@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end)
}
}
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff)
void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff)
{
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
int32 co, uo, ud, vo, vd;
INT32 co, uo, ud, vo, vd;
Texts_Find(T, &beg, &u, &uo, &ud);
Texts_Split(ud, &u, &un);
c = T->cache;
@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo
}
}
void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos)
void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos)
{
Texts_Run u = NIL;
if (pos >= T->len) {
@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos
}
}
void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch)
void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch)
{
Texts_Run u = NIL;
int32 pos;
INT32 pos;
CHAR nextch;
u = (*R).run;
(*R).fnt = u->fnt;
@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch)
}
}
void Texts_ReadElem (Texts_Reader *R, address *R__typ)
void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ)
{
Texts_Run u = NIL, un = NIL;
u = (*R).run;
@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ)
}
}
void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ)
{
Texts_Run u = NIL;
u = (*R).run->prev;
@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ)
}
}
int32 Texts_Pos (Texts_Reader *R, address *R__typ)
INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ)
{
return (*R).org + (*R).off;
}
void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos)
void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos)
{
Texts_OpenReader((void*)&*S, S__typ, T, pos);
(*S).line = 0;
@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p
static struct Scan__31 {
Texts_Scanner *S;
address *S__typ;
ADDRESS *S__typ;
CHAR *ch;
BOOLEAN *negE;
int16 *e;
INT16 *e;
struct Scan__31 *lnk;
} *Scan__31_s;
@ -740,18 +740,18 @@ 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 + (int16)*Scan__31_s->ch) - 48;
*Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
void Texts_Scan (Texts_Scanner *S, address *S__typ)
void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ)
{
CHAR ch, term;
BOOLEAN neg, negE, hex;
int8 i, j, h;
int16 e;
int32 k;
INT8 i, j, h;
INT16 e;
INT32 k;
REAL x, f;
LONGREAL y, g;
CHAR d[32];
@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
if ('9' < ch) {
if (('A' <= ch && ch <= 'F')) {
hex = 1;
ch = (CHAR)((int16)ch - 7);
ch = (CHAR)((INT16)ch - 7);
} else if (('a' <= ch && ch <= 'f')) {
hex = 1;
ch = (CHAR)((int16)ch - 39);
ch = (CHAR)((INT16)ch - 39);
} else {
break;
}
@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
if (i - j > 8) {
j = i - 8;
}
k = (int16)d[__X(j, 32)] - 48;
k = (INT16)d[__X(j, 32)] - 48;
j += 1;
if ((i - j == 7 && k >= 8)) {
k -= 16;
}
while (j < i) {
k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48);
k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48);
j += 1;
}
if (neg) {
@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
y = (LONGREAL)0;
g = (LONGREAL)1;
do {
y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48);
y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
g = g / (LONGREAL)(LONGREAL)10;
y = ((int16)d[__X(j, 32)] - 48) * g + y;
y = ((INT16)d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__32();
@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
x = (REAL)0;
f = (REAL)1;
do {
x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48);
x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
f = f / (REAL)(REAL)10;
x = ((int16)d[__X(j, 32)] - 48) * f + x;
x = ((INT16)d[__X(j, 32)] - 48) * f + x;
j += 1;
}
if (ch == 'E') {
@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
(*S).class = 3;
k = 0;
do {
k = k * 10 + ((int16)d[__X(j, 32)] - 48);
k = k * 10 + ((INT16)d[__X(j, 32)] - 48);
j += 1;
} while (!(j == i));
if (neg) {
@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ)
Scan__31_s = _s.lnk;
}
void Texts_OpenWriter (Texts_Writer *W, address *W__typ)
void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ)
{
__NEW((*W).buf, Texts_BufDesc);
Texts_OpenBuf((*W).buf);
@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ)
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0);
}
void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt)
void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt)
{
(*W).fnt = fnt;
}
void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col)
void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col)
{
(*W).col = col;
}
void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff)
void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff)
{
(*W).voff = voff;
}
void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch)
void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch)
{
Texts_Run u = NIL, un = NIL;
Texts_Piece p = NIL;
@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch)
}
}
void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e)
void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e)
{
Texts_Run u = NIL, un = NIL;
if (e->base != NIL) {
@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e)
un->prev = (Texts_Run)e;
}
void Texts_WriteLn (Texts_Writer *W, address *W__typ)
void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ)
{
Texts_Write(&*W, W__typ, 0x0d);
}
void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len)
void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
i = 0;
while (s[__X(i, s__len)] >= ' ') {
@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le
__DEL(s);
}
void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n)
{
int16 i;
int64 x0;
INT16 i;
INT64 x0;
CHAR a[24];
i = 0;
if (x < 0) {
@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
x0 = __DIV(x0, 10);
i += 1;
} while (!(x0 == 0));
while (n > (int64)i) {
while (n > (INT64)i) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
}
@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n)
} while (!(i == 0));
}
void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x)
void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x)
{
int16 i;
int32 y;
INT16 i;
INT32 y;
CHAR a[20];
i = 0;
Texts_Write(&*W, W__typ, ' ');
@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x)
} while (!(i == 0));
}
void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n)
void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n)
{
int16 e;
INT16 e;
REAL x0;
CHAR d[9];
e = Reals_Expo(x);
@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n)
static struct WriteRealFix__53 {
Texts_Writer *W;
address *W__typ;
int16 *i;
ADDRESS *W__typ;
INT16 *i;
CHAR (*d)[9];
struct WriteRealFix__53 *lnk;
} *WriteRealFix__53_s;
static void dig__54 (int16 n);
static void seq__56 (CHAR ch, int16 n);
static void dig__54 (INT16 n);
static void seq__56 (CHAR ch, INT16 n);
static void seq__56 (CHAR ch, int16 n)
static void seq__56 (CHAR ch, INT16 n)
{
while (n > 0) {
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch);
@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n)
}
}
static void dig__54 (int16 n)
static void dig__54 (INT16 n)
{
while (n > 0) {
*WriteRealFix__53_s->i -= 1;
@ -1195,9 +1195,9 @@ static void dig__54 (int16 n)
}
}
void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k)
void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k)
{
int16 e, i;
INT16 e, i;
CHAR sign;
REAL x0;
CHAR d[9];
@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1
WriteRealFix__53_s = _s.lnk;
}
void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x)
void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x)
{
int16 i;
INT16 i;
CHAR d[8];
Reals_ConvertH(x, (void*)d, 8);
i = 0;
@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x)
} while (!(i == 8));
}
void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n)
{
int16 e;
INT16 e;
LONGREAL x0;
CHAR d[16];
e = Reals_ExpoL(x);
@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
} else {
Texts_Write(&*W, W__typ, ' ');
}
e = (int16)__ASHR((e - 1023) * 77, 8);
e = (INT16)__ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Reals_TenL(e);
} else {
@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n)
}
}
void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x)
void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x)
{
int16 i;
INT16 i;
CHAR d[16];
Reals_ConvertHL(x, (void*)d, 16);
i = 0;
@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x)
static struct WriteDate__43 {
Texts_Writer *W;
address *W__typ;
ADDRESS *W__typ;
struct WriteDate__43 *lnk;
} *WriteDate__43_s;
static void WritePair__44 (CHAR ch, int32 x);
static void WritePair__44 (CHAR ch, INT32 x);
static void WritePair__44 (CHAR ch, int32 x)
static void WritePair__44 (CHAR ch, INT32 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)((int)__MOD(x, 10) + 48));
}
void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d)
void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d)
{
struct WriteDate__43 _s;
_s.W = W; _s.W__typ = W__typ;
@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d)
static struct Load0__16 {
Texts_Text *T;
int8 *ecnt;
INT8 *ecnt;
Files_File *f;
Texts_FileMsg *msg;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Load0__16 *lnk;
} *Load0__16_s;
static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e);
static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e);
static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e)
static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e)
{
Modules_Module M = NIL;
Modules_Command Cmd;
Texts_Alien a = NIL;
int32 org, ew, eh;
int8 eno;
INT32 org, ew, eh;
INT8 eno;
Texts_new = NIL;
Files_ReadLInt(&*r, r__typ, &ew);
Files_ReadLInt(&*r, r__typ, &eh);
@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span
}
}
static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
Texts_Run u = NIL, un = NIL;
Texts_Piece p = NIL;
Texts_Elem e = NIL;
int32 org, pos, hlen, plen;
int8 ecnt, fcnt, fno, col, voff;
INT32 org, pos, hlen, plen;
INT8 ecnt, fcnt, fno, col, voff;
Files_File f = NIL;
Texts_FileMsg msg;
CHAR mods[64][32], procs[64][32];
@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T)
Load0__16_s = _s.lnk;
}
void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T)
void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
int16 tag;
INT16 tag;
Files_ReadInt(&*r, r__typ, &tag);
if (tag != -4095) {
Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2);
@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
Texts_Run u = NIL;
Texts_Piece p = NIL;
CHAR tag, version;
int32 hlen;
INT32 hlen;
__DUP(name, name__len, CHAR);
f = Files_Old(name, name__len);
if (f == NIL) {
@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
}
static struct Store__39 {
int8 *ecnt;
INT8 *ecnt;
Texts_FileMsg *msg;
Texts_IdentifyMsg *iden;
CHAR (*mods)[64][32], (*procs)[64][32];
struct Store__39 *lnk;
} *Store__39_s;
static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e);
static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e);
static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e)
static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e)
{
Files_Rider r1;
int32 org, span;
int8 eno;
INT32 org, span;
INT8 eno;
__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;
@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele
Files_WriteLInt(&r1, Files_Rider__typ, e->H);
}
void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T)
void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T)
{
Files_Rider r1;
Texts_Run u = NIL, un = NIL;
Texts_Elem e = NIL;
int32 org, pos, delta, hlen, rlen;
int8 ecnt, fcnt;
INT32 org, pos, delta, hlen, rlen;
INT8 ecnt, fcnt;
CHAR ch;
int8 fno;
INT8 fno;
Texts_FileMsg msg;
Texts_IdentifyMsg iden;
CHAR mods[64][32], procs[64][32];
@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
{
Files_File f = NIL;
Files_Rider r;
int16 i, res;
INT16 i, res;
CHAR bak[64];
__DUP(name, name__len, CHAR);
f = Files_New(name, name__len);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Texts__h
#define Texts__h
@ -8,7 +8,7 @@
typedef
struct Texts_BufDesc {
int32 len;
INT32 len;
char _prvt0[4];
} Texts_BufDesc;
@ -30,25 +30,25 @@ typedef
typedef
struct Texts_RunDesc {
int32 _prvt0;
INT32 _prvt0;
char _prvt1[15];
} Texts_RunDesc;
typedef
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *);
void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *);
typedef
struct Texts_ElemDesc {
char _prvt0[20];
int32 W, H;
INT32 W, H;
Texts_Handler handle;
char _prvt1[4];
} Texts_ElemDesc;
typedef
struct Texts_FileMsg { /* Texts_ElemMsg */
int16 id;
int32 pos;
INT16 id;
INT32 pos;
Files_Rider r;
} Texts_FileMsg;
@ -69,13 +69,13 @@ typedef
struct Texts_TextDesc *Texts_Text;
typedef
void (*Texts_Notifier)(Texts_Text, int16, int32, int32);
void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32);
typedef
struct Texts_Reader {
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
char _prvt0[32];
} Texts_Reader;
@ -84,23 +84,23 @@ typedef
struct Texts_Scanner { /* Texts_Reader */
BOOLEAN eot;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
Texts_Elem elem;
int64 _prvt0;
INT64 _prvt0;
char _prvt1[24];
CHAR nextCh;
int16 line, class;
int32 i;
INT16 line, class;
INT32 i;
REAL x;
LONGREAL y;
CHAR c;
int8 len;
INT8 len;
CHAR s[64];
} Texts_Scanner;
typedef
struct Texts_TextDesc {
int32 len;
INT32 len;
Texts_Notifier notify;
char _prvt0[12];
} Texts_TextDesc;
@ -109,64 +109,64 @@ typedef
struct Texts_Writer {
Texts_Buffer buf;
Texts_FontsFont fnt;
int8 col, voff;
INT8 col, voff;
char _prvt0[26];
} Texts_Writer;
import Texts_Elem Texts_new;
import address *Texts_FontDesc__typ;
import address *Texts_RunDesc__typ;
import address *Texts_ElemMsg__typ;
import address *Texts_ElemDesc__typ;
import address *Texts_FileMsg__typ;
import address *Texts_CopyMsg__typ;
import address *Texts_IdentifyMsg__typ;
import address *Texts_BufDesc__typ;
import address *Texts_TextDesc__typ;
import address *Texts_Reader__typ;
import address *Texts_Scanner__typ;
import address *Texts_Writer__typ;
import ADDRESS *Texts_FontDesc__typ;
import ADDRESS *Texts_RunDesc__typ;
import ADDRESS *Texts_ElemMsg__typ;
import ADDRESS *Texts_ElemDesc__typ;
import ADDRESS *Texts_FileMsg__typ;
import ADDRESS *Texts_CopyMsg__typ;
import ADDRESS *Texts_IdentifyMsg__typ;
import ADDRESS *Texts_BufDesc__typ;
import ADDRESS *Texts_TextDesc__typ;
import ADDRESS *Texts_Reader__typ;
import ADDRESS *Texts_Scanner__typ;
import ADDRESS *Texts_Writer__typ;
import void Texts_Append (Texts_Text T, Texts_Buffer B);
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff);
import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
import void Texts_Delete (Texts_Text T, int32 beg, int32 end);
import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end);
import Texts_Text Texts_ElemBase (Texts_Elem E);
import int32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B);
import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T);
import INT32 Texts_ElemPos (Texts_Elem E);
import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B);
import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len);
import void Texts_OpenBuf (Texts_Buffer B);
import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos);
import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos);
import void Texts_OpenWriter (Texts_Writer *W, address *W__typ);
import int32 Texts_Pos (Texts_Reader *R, address *R__typ);
import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch);
import void Texts_ReadElem (Texts_Reader *R, address *R__typ);
import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ);
import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos);
import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos);
import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ);
import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch);
import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ);
import void Texts_Recall (Texts_Buffer *B);
import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B);
import void Texts_Scan (Texts_Scanner *S, address *S__typ);
import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col);
import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt);
import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff);
import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T);
import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch);
import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d);
import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e);
import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x);
import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n);
import void Texts_WriteLn (Texts_Writer *W, address *W__typ);
import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n);
import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x);
import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n);
import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k);
import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x);
import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len);
import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B);
import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ);
import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col);
import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt);
import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff);
import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T);
import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch);
import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d);
import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e);
import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x);
import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n);
import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ);
import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n);
import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x);
import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n);
import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k);
import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x);
import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len);
import void *Texts__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Out.h"
@ -14,36 +14,36 @@ export CHAR VT100_CSI[5];
static CHAR VT100_tmpstr[32];
export void VT100_CHA (int16 n);
export void VT100_CNL (int16 n);
export void VT100_CPL (int16 n);
export void VT100_CUB (int16 n);
export void VT100_CUD (int16 n);
export void VT100_CUF (int16 n);
export void VT100_CUP (int16 n, int16 m);
export void VT100_CUU (int16 n);
export void VT100_CHA (INT16 n);
export void VT100_CNL (INT16 n);
export void VT100_CPL (INT16 n);
export void VT100_CUB (INT16 n);
export void VT100_CUD (INT16 n);
export void VT100_CUF (INT16 n);
export void VT100_CUP (INT16 n, INT16 m);
export void VT100_CUU (INT16 n);
export void VT100_DECTCEMh (void);
export void VT100_DECTCEMl (void);
export void VT100_DSR (int16 n);
export void VT100_ED (int16 n);
export void VT100_EL (int16 n);
static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len);
export void VT100_DSR (INT16 n);
export void VT100_ED (INT16 n);
export void VT100_EL (INT16 n);
static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len);
static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len);
export void VT100_HVP (int16 n, int16 m);
export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len);
static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len);
static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len);
export void VT100_HVP (INT16 n, INT16 m);
export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len);
export void VT100_RCP (void);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end);
export void VT100_SCP (void);
export void VT100_SD (int16 n);
export void VT100_SGR (int16 n);
export void VT100_SGR2 (int16 n, int16 m);
export void VT100_SU (int16 n);
export void VT100_SD (INT16 n);
export void VT100_SGR (INT16 n);
export void VT100_SGR2 (INT16 n, INT16 m);
export void VT100_SU (INT16 n);
export void VT100_SetAttr (CHAR *attr, LONGINT attr__len);
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end)
static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end)
{
CHAR h;
while (start < end) {
@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end)
}
}
void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len)
void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len)
{
CHAR b[21];
int16 s, e;
int8 maxLength;
INT16 s, e;
INT8 maxLength;
maxLength = 11;
if (int_ == (-2147483647-1)) {
__MOVE("-2147483648", b, 12);
@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[2];
CHAR cmd[7];
@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[2];
CHAR cmd[7];
@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len)
{
CHAR nstr[5], mstr[5];
CHAR cmd[12];
@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len)
__DEL(letter);
}
void VT100_CUU (int16 n)
void VT100_CUU (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"A", 2);
}
void VT100_CUD (int16 n)
void VT100_CUD (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"B", 2);
}
void VT100_CUF (int16 n)
void VT100_CUF (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"C", 2);
}
void VT100_CUB (int16 n)
void VT100_CUB (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"D", 2);
}
void VT100_CNL (int16 n)
void VT100_CNL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"E", 2);
}
void VT100_CPL (int16 n)
void VT100_CPL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"F", 2);
}
void VT100_CHA (int16 n)
void VT100_CHA (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"G", 2);
}
void VT100_CUP (int16 n, int16 m)
void VT100_CUP (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"H", 2);
}
void VT100_ED (int16 n)
void VT100_ED (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"J", 2);
}
void VT100_EL (int16 n)
void VT100_EL (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"K", 2);
}
void VT100_SU (int16 n)
void VT100_SU (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"S", 2);
}
void VT100_SD (int16 n)
void VT100_SD (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"T", 2);
}
void VT100_HVP (int16 n, int16 m)
void VT100_HVP (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"f", 2);
}
void VT100_SGR (int16 n)
void VT100_SGR (INT16 n)
{
VT100_EscSeq(n, (CHAR*)"m", 2);
}
void VT100_SGR2 (int16 n, int16 m)
void VT100_SGR2 (INT16 n, INT16 m)
{
VT100_EscSeq2(n, m, (CHAR*)"m", 2);
}
void VT100_DSR (int16 n)
void VT100_DSR (INT16 n)
{
VT100_EscSeq(6, (CHAR*)"n", 2);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef VT100__h
#define VT100__h
@ -9,27 +9,27 @@
import CHAR VT100_CSI[5];
import void VT100_CHA (int16 n);
import void VT100_CNL (int16 n);
import void VT100_CPL (int16 n);
import void VT100_CUB (int16 n);
import void VT100_CUD (int16 n);
import void VT100_CUF (int16 n);
import void VT100_CUP (int16 n, int16 m);
import void VT100_CUU (int16 n);
import void VT100_CHA (INT16 n);
import void VT100_CNL (INT16 n);
import void VT100_CPL (INT16 n);
import void VT100_CUB (INT16 n);
import void VT100_CUD (INT16 n);
import void VT100_CUF (INT16 n);
import void VT100_CUP (INT16 n, INT16 m);
import void VT100_CUU (INT16 n);
import void VT100_DECTCEMh (void);
import void VT100_DECTCEMl (void);
import void VT100_DSR (int16 n);
import void VT100_ED (int16 n);
import void VT100_EL (int16 n);
import void VT100_HVP (int16 n, int16 m);
import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len);
import void VT100_DSR (INT16 n);
import void VT100_ED (INT16 n);
import void VT100_EL (INT16 n);
import void VT100_HVP (INT16 n, INT16 m);
import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len);
import void VT100_RCP (void);
import void VT100_SCP (void);
import void VT100_SD (int16 n);
import void VT100_SGR (int16 n);
import void VT100_SGR2 (int16 n, int16 m);
import void VT100_SU (int16 n);
import void VT100_SD (INT16 n);
import void VT100_SGR (INT16 n);
import void VT100_SGR2 (INT16 n, INT16 m);
import void VT100_SU (INT16 n);
import void VT100_SetAttr (CHAR *attr, LONGINT attr__len);
import void *VT100__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len)
{
int16 r, status, exitcode;
INT16 r, status, exitcode;
__DUP(title, title__len, CHAR);
__DUP(cmd, cmd__len, CHAR);
if (__IN(18, OPM_Options, 32)) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -26,7 +26,7 @@ static CHAR Compiler_mname[256];
export void Compiler_Module (BOOLEAN *done);
static void Compiler_PropagateElementaryTypeSizes (void);
export void Compiler_Translate (void);
static void Compiler_Trap (int32 sig);
static void Compiler_Trap (INT32 sig);
void Compiler_Module (BOOLEAN *done)
@ -147,7 +147,7 @@ void Compiler_Translate (void)
}
}
static void Compiler_Trap (int32 sig)
static void Compiler_Trap (INT32 sig)
{
Heap_FINALL();
if (sig == 3) {

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -18,7 +18,7 @@ typedef
struct Files_BufDesc {
Files_File f;
BOOLEAN chg;
int32 org, size;
INT32 org, size;
SYSTEM_BYTE data[4096];
} Files_BufDesc;
@ -33,85 +33,85 @@ typedef
Files_FileName workName, registerName;
BOOLEAN tempFile;
Platform_FileIdentity identity;
int32 fd, len, pos;
INT32 fd, len, pos;
Files_Buffer bufs[4];
int16 swapper, state;
INT16 swapper, state;
Files_File next;
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
Files_Buffer buf;
int32 org, offset;
INT32 org, offset;
} Files_Rider;
static Files_File Files_files;
static int16 Files_tempno;
static INT16 Files_tempno;
static CHAR Files_HOME[1024];
static struct {
LONGINT len[1];
CHAR data[1];
} *Files_SearchPath;
export address *Files_FileDesc__typ;
export address *Files_BufDesc__typ;
export address *Files_Rider__typ;
export ADDRESS *Files_FileDesc__typ;
export ADDRESS *Files_BufDesc__typ;
export ADDRESS *Files_Rider__typ;
export Files_File Files_Base (Files_Rider *r, address *r__typ);
export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
static Files_File Files_CacheEntry (Platform_FileIdentity identity);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
export void Files_Close (Files_File f);
static void Files_CloseOSFile (Files_File f);
static void Files_Create (Files_File f);
export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode);
export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode);
static void Files_Finalize (SYSTEM_PTR o);
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len);
static void Files_Flush (Files_Buffer buf);
export void Files_GetDate (Files_File f, int32 *t, int32 *d);
export void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len);
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len);
export int32 Files_Length (Files_File f);
export INT32 Files_Length (Files_File f);
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len);
export Files_File Files_New (CHAR *name, LONGINT name__len);
export Files_File Files_Old (CHAR *name, LONGINT name__len);
export int32 Files_Pos (Files_Rider *r, address *r__typ);
export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
export void Files_Purge (Files_File f);
export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
export void Files_Register (Files_File f);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len);
export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
export void Files_SetSearchPath (CHAR *path, LONGINT path__len);
export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
#define Files_IdxTrap() __HALT(-1)
#define Files_ToAdr(x) (address)x
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode)
{
__DUP(s, s__len, CHAR);
Out_Ln();
@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len)
{
int16 i, j;
INT16 i, j;
__DUP(dir, dir__len, CHAR);
__DUP(name, name__len, CHAR);
i = 0;
@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT
static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len)
{
int32 n, i, j;
INT32 n, i, j;
__DUP(finalName, finalName__len, CHAR);
Files_tempno += 1;
n = Files_tempno;
@ -217,7 +217,7 @@ static void Files_Create (Files_File f)
{
Platform_FileIdentity identity;
BOOLEAN done;
int16 error;
INT16 error;
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
@ -254,7 +254,7 @@ static void Files_Create (Files_File f)
static void Files_Flush (Files_Buffer buf)
{
int16 error;
INT16 error;
Files_File f = NIL;
if (buf->chg) {
f = buf->f;
@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf)
static void Files_CloseOSFile (Files_File f)
{
Files_File prev = NIL;
int16 error;
INT16 error;
if (Files_files == f) {
Files_files = f->next;
} else {
@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f)
void Files_Close (Files_File f)
{
int32 i;
int16 error;
INT32 i;
INT16 error;
if (f->state != 1 || f->registerName[0] != 0x00) {
Files_Create(f);
i = 0;
@ -315,7 +315,7 @@ void Files_Close (Files_File f)
}
}
int32 Files_Length (Files_File f)
INT32 Files_Length (Files_File f)
{
return f->len;
}
@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
return f;
}
static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
if (Files_SearchPath == NIL) {
@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len)
static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
ch = name[0];
@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len)
static Files_File Files_CacheEntry (Platform_FileIdentity identity)
{
Files_File f = NIL;
int16 i, error;
INT16 i, error;
f = Files_files;
while (f != NIL) {
if (Platform_SameFile(identity, f->identity)) {
@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity)
Files_File Files_Old (CHAR *name, LONGINT name__len)
{
Files_File f = NIL;
int32 fd;
int16 pos;
INT32 fd;
INT16 pos;
BOOLEAN done;
CHAR dir[256], path[256];
int16 error;
INT16 error;
Platform_FileIdentity identity;
__DUP(name, name__len, CHAR);
if (name[0] != 0x00) {
@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
void Files_Purge (Files_File f)
{
int16 i;
INT16 i;
Platform_FileIdentity identity;
int16 error;
INT16 error;
i = 0;
while (i < 4) {
if (f->bufs[i] != NIL) {
@ -519,25 +519,25 @@ void Files_Purge (Files_File f)
Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity);
}
void Files_GetDate (Files_File f, int32 *t, int32 *d)
void Files_GetDate (Files_File f, INT32 *t, INT32 *d)
{
Platform_FileIdentity identity;
int16 error;
INT16 error;
Files_Create(f);
error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ);
Platform_MTimeAsClock(identity, &*t, &*d);
}
int32 Files_Pos (Files_Rider *r, address *r__typ)
INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).org + (*r).offset;
}
void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos)
{
int32 org, offset, i, n;
INT32 org, offset, i, n;
Files_Buffer buf = NIL;
int16 error;
INT16 error;
if (f != NIL) {
if (pos > f->len) {
pos = f->len;
@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos)
(*r).res = 0;
}
void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
{
int32 offset;
INT32 offset;
Files_Buffer buf = NIL;
buf = (*r).buf;
offset = (*r).offset;
@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x)
}
}
void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
(*r).eof = 0;
}
Files_File Files_Base (Files_Rider *r, address *r__typ)
Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ)
{
return (*r).buf->f;
}
void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x)
{
Files_Buffer buf = NIL;
int32 offset;
INT32 offset;
buf = (*r).buf;
offset = (*r).offset;
if ((*r).org != buf->org || offset >= 4096) {
@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x)
(*r).res = 0;
}
void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n)
void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n)
{
int32 xpos, min, restInBuf, offset;
INT32 xpos, min, restInBuf, offset;
Files_Buffer buf = NIL;
if (n > x__len) {
Files_IdxTrap();
@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
(*r).res = 0;
}
void Files_Delete (CHAR *name, LONGINT name__len, int16 *res)
void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res)
{
__DUP(name, name__len, CHAR);
*res = Platform_Unlink((void*)name, name__len);
__DEL(name);
}
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res)
void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res)
{
int32 fdold, fdnew, n;
int16 error, ignore;
INT32 fdold, fdnew, n;
INT16 error, ignore;
Platform_FileIdentity oldidentity, newidentity;
CHAR buf[4096];
__DUP(old, old__len, CHAR);
@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int
void Files_Register (Files_File f)
{
int16 idx, errcode;
INT16 idx, errcode;
Files_File f1 = NIL;
CHAR file[104];
if ((f->state == 1 && f->registerName[0] != 0x00)) {
@ -807,7 +807,7 @@ void Files_Register (Files_File f)
}
}
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res)
{
__DUP(path, path__len, CHAR);
*res = Platform_Chdir((void*)path, path__len);
@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res)
static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len)
{
int32 i, j;
INT32 i, j;
if (!Platform_LittleEndian) {
i = src__len;
j = 0;
@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
}
}
void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x)
void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x)
{
Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
}
void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x)
void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = (int16)b[0] + __ASHL((int16)b[1], 8);
*x = (INT16)b[0] + __ASHL((INT16)b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x)
{
CHAR b[4];
int32 l;
INT32 l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (uint32)l;
l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = (UINT32)l;
}
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x)
void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
i = 0;
do {
@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!(ch == 0x00));
}
void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
CHAR ch;
BOOLEAN b;
i = 0;
@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
} while (!b);
}
void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
int8 s, b;
int64 q;
INT8 s, b;
INT64 q;
s = 0;
q = 0;
Files_Read(&*R, R__typ, (void*)&b);
while (b < 0) {
q += (int64)__ASH(((int16)b + 128), s);
q += (INT64)__ASH(((INT16)b + 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&b);
}
q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s);
__ASSERT(x__len <= 8, 0);
__MOVE((address)&q, (address)x, x__len);
}
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x)
{
Files_Write(&*R, R__typ, __VAL(CHAR, x));
}
void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x)
{
CHAR b[2];
b[0] = (CHAR)x;
@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x)
{
CHAR b[4];
b[0] = (CHAR)x;
@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x)
{
CHAR b[4];
int32 i;
i = (int32)x;
INT32 i;
i = (INT32)x;
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x)
void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x)
void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len)
void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len)
{
int16 i;
INT16 i;
i = 0;
while (x[i] != 0x00) {
i += 1;
@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x)
{
while (x < -64 || x > 63) {
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len)
static void Files_Finalize (SYSTEM_PTR o)
{
Files_File f = NIL;
int32 res;
INT32 res;
f = (Files_File)(address)o;
if (f->fd >= 0) {
Files_CloseOSFile(f);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef Files__h
#define Files__h
@ -10,61 +10,61 @@ typedef
typedef
struct Files_FileDesc {
int64 _prvt0;
INT64 _prvt0;
char _prvt1[208];
int32 fd;
INT32 fd;
char _prvt2[60];
} Files_FileDesc;
typedef
struct Files_Rider {
int32 res;
INT32 res;
BOOLEAN eof;
int64 _prvt0;
INT64 _prvt0;
char _prvt1[8];
} Files_Rider;
import address *Files_FileDesc__typ;
import address *Files_Rider__typ;
import ADDRESS *Files_FileDesc__typ;
import ADDRESS *Files_Rider__typ;
import Files_File Files_Base (Files_Rider *r, address *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res);
import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res);
import void Files_Close (Files_File f);
import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res);
import void Files_GetDate (Files_File f, int32 *t, int32 *d);
import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res);
import void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len);
import int32 Files_Length (Files_File f);
import INT32 Files_Length (Files_File f);
import Files_File Files_New (CHAR *name, LONGINT name__len);
import Files_File Files_Old (CHAR *name, LONGINT name__len);
import int32 Files_Pos (Files_Rider *r, address *r__typ);
import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ);
import void Files_Purge (Files_File f);
import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x);
import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x);
import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x);
import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x);
import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x);
import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x);
import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len);
import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x);
import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x);
import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void Files_Register (Files_File f);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos);
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res);
import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
import void Files_SetSearchPath (CHAR *path, LONGINT path__len);
import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n);
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n);
import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x);
import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x);
import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x);
import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x);
import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x);
import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x);
import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len);
import void *Files__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
@ -40,7 +40,7 @@ typedef
typedef
struct Heap_FinDesc {
Heap_FinNode next;
int64 obj;
INT64 obj;
BOOLEAN marked;
Heap_Finalizer finalize;
} Heap_FinDesc;
@ -55,53 +55,53 @@ typedef
struct Heap_ModuleDesc {
Heap_Module next;
Heap_ModuleName name;
int32 refcnt;
INT32 refcnt;
Heap_Cmd cmds;
int64 types;
INT64 types;
Heap_EnumProc enumPtrs;
int32 reserved1, reserved2;
INT32 reserved1, reserved2;
} Heap_ModuleDesc;
export SYSTEM_PTR Heap_modules;
static int64 Heap_freeList[10];
static int64 Heap_bigBlocks;
export int64 Heap_allocated;
static INT64 Heap_freeList[10];
static INT64 Heap_bigBlocks;
export INT64 Heap_allocated;
static BOOLEAN Heap_firstTry;
static int64 Heap_heap, Heap_heapend;
export int64 Heap_heapsize;
static INT64 Heap_heap, Heap_heapend;
export INT64 Heap_heapsize;
static Heap_FinNode Heap_fin;
static int16 Heap_lockdepth;
static INT16 Heap_lockdepth;
static BOOLEAN Heap_interrupted;
export int16 Heap_FileCount;
export INT16 Heap_FileCount;
export address *Heap_ModuleDesc__typ;
export address *Heap_CmdDesc__typ;
export address *Heap_FinDesc__typ;
export address *Heap__1__typ;
export ADDRESS *Heap_ModuleDesc__typ;
export ADDRESS *Heap_CmdDesc__typ;
export ADDRESS *Heap_FinDesc__typ;
export ADDRESS *Heap__1__typ;
static void Heap_CheckFin (void);
static void Heap_ExtendHeap (int64 blksz);
static void Heap_ExtendHeap (INT64 blksz);
export void Heap_FINALL (void);
static void Heap_Finalize (void);
export void Heap_GC (BOOLEAN markStack);
static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len);
static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len);
export void Heap_INCREF (Heap_Module m);
export void Heap_InitHeap (void);
export void Heap_Lock (void);
static void Heap_Mark (int64 q);
static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len);
static void Heap_Mark (INT64 q);
static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len);
static void Heap_MarkP (SYSTEM_PTR p);
static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (int64 size);
export SYSTEM_PTR Heap_NEWREC (int64 tag);
static int64 Heap_NewChunk (int64 blksz);
static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len);
export SYSTEM_PTR Heap_NEWBLK (INT64 size);
export SYSTEM_PTR Heap_NEWREC (INT64 tag);
static INT64 Heap_NewChunk (INT64 blksz);
export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
export void Heap_REGTYP (Heap_Module m, int64 typ);
export void Heap_REGTYP (Heap_Module m, INT64 typ);
export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
static void Heap_Scan (void);
static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len);
static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len);
export void Heap_Unlock (void);
extern void *Heap__init();
@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
m->cmds = c;
}
void Heap_REGTYP (Heap_Module m, int64 typ)
void Heap_REGTYP (Heap_Module m, INT64 typ)
{
__PUT(typ, m->types, int64);
__PUT(typ, m->types, INT64);
m->types = typ;
}
@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m)
m->refcnt += 1;
}
static int64 Heap_NewChunk (int64 blksz)
static INT64 Heap_NewChunk (INT64 blksz)
{
int64 chnk;
INT64 chnk;
chnk = Heap_OSAllocate(blksz + 24);
if (chnk != 0) {
__PUT(chnk + 8, chnk + (24 + blksz), int64);
__PUT(chnk + 24, chnk + 32, int64);
__PUT(chnk + 32, blksz, int64);
__PUT(chnk + 40, -8, int64);
__PUT(chnk + 48, Heap_bigBlocks, int64);
__PUT(chnk + 8, chnk + (24 + blksz), INT64);
__PUT(chnk + 24, chnk + 32, INT64);
__PUT(chnk + 32, blksz, INT64);
__PUT(chnk + 40, -8, INT64);
__PUT(chnk + 48, Heap_bigBlocks, INT64);
Heap_bigBlocks = chnk + 24;
Heap_heapsize += blksz;
}
return chnk;
}
static void Heap_ExtendHeap (int64 blksz)
static void Heap_ExtendHeap (INT64 blksz)
{
int64 size, chnk, j, next;
INT64 size, chnk, j, next;
if (blksz > 320000) {
size = blksz;
} else {
@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int64 blksz)
chnk = Heap_NewChunk(size);
if (chnk != 0) {
if (chnk < Heap_heap) {
__PUT(chnk, Heap_heap, int64);
__PUT(chnk, Heap_heap, INT64);
Heap_heap = chnk;
} else {
j = Heap_heap;
__GET(j, next, int64);
__GET(j, next, INT64);
while ((next != 0 && chnk > next)) {
j = next;
__GET(j, next, int64);
__GET(j, next, INT64);
}
__PUT(chnk, next, int64);
__PUT(j, chnk, int64);
__PUT(chnk, next, INT64);
__PUT(j, chnk, INT64);
}
if (next == 0) {
__GET(chnk + 8, Heap_heapend, int64);
__GET(chnk + 8, Heap_heapend, INT64);
}
}
}
SYSTEM_PTR Heap_NEWREC (int64 tag)
SYSTEM_PTR Heap_NEWREC (INT64 tag)
{
int64 i, i0, di, blksz, restsize, t, adr, end, next, prev;
INT64 i, i0, di, blksz, restsize, t, adr, end, next, prev;
SYSTEM_PTR new;
Heap_Lock();
__GET(tag, blksz, int64);
__GET(tag, blksz, INT64);
i0 = __ASHR(blksz, 5);
i = i0;
if (i < 9) {
@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
}
}
if (i < 9) {
__GET(adr + 24, next, int64);
__GET(adr + 24, next, INT64);
Heap_freeList[i] = next;
if (i != i0) {
di = i - i0;
restsize = __ASHL(di, 5);
end = adr + restsize;
__PUT(end + 8, blksz, int64);
__PUT(end + 16, -8, int64);
__PUT(end, end + 8, int64);
__PUT(adr + 8, restsize, int64);
__PUT(adr + 24, Heap_freeList[di], int64);
__PUT(end + 8, blksz, INT64);
__PUT(end + 16, -8, INT64);
__PUT(end, end + 8, INT64);
__PUT(adr + 8, restsize, INT64);
__PUT(adr + 24, Heap_freeList[di], INT64);
Heap_freeList[di] = adr;
adr += restsize;
}
@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
return NIL;
}
}
__GET(adr + 8, t, int64);
__GET(adr + 8, t, INT64);
if (t >= blksz) {
break;
}
prev = adr;
__GET(adr + 24, adr, int64);
__GET(adr + 24, adr, INT64);
}
restsize = t - blksz;
end = adr + restsize;
__PUT(end + 8, blksz, int64);
__PUT(end + 16, -8, int64);
__PUT(end, end + 8, int64);
__PUT(end + 8, blksz, INT64);
__PUT(end + 16, -8, INT64);
__PUT(end, end + 8, INT64);
if (restsize > 288) {
__PUT(adr + 8, restsize, int64);
__PUT(adr + 8, restsize, INT64);
} else {
__GET(adr + 24, next, int64);
__GET(adr + 24, next, INT64);
if (prev == 0) {
Heap_bigBlocks = next;
} else {
__PUT(prev + 24, next, int64);
__PUT(prev + 24, next, INT64);
}
if (restsize > 0) {
di = __ASHR(restsize, 5);
__PUT(adr + 8, restsize, int64);
__PUT(adr + 24, Heap_freeList[di], int64);
__PUT(adr + 8, restsize, INT64);
__PUT(adr + 24, Heap_freeList[di], INT64);
Heap_freeList[di] = adr;
}
}
@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int64 tag)
i = adr + 32;
end = adr + blksz;
while (i < end) {
__PUT(i, 0, int64);
__PUT(i + 8, 0, int64);
__PUT(i + 16, 0, int64);
__PUT(i + 24, 0, int64);
__PUT(i, 0, INT64);
__PUT(i + 8, 0, INT64);
__PUT(i + 16, 0, INT64);
__PUT(i + 24, 0, INT64);
i += 32;
}
__PUT(adr + 24, 0, int64);
__PUT(adr, tag, int64);
__PUT(adr + 8, 0, int64);
__PUT(adr + 16, 0, int64);
__PUT(adr + 24, 0, INT64);
__PUT(adr, tag, INT64);
__PUT(adr + 8, 0, INT64);
__PUT(adr + 16, 0, INT64);
Heap_allocated += blksz;
Heap_Unlock();
return (SYSTEM_PTR)(address)(adr + 8);
}
SYSTEM_PTR Heap_NEWBLK (int64 size)
SYSTEM_PTR Heap_NEWBLK (INT64 size)
{
int64 blksz, tag;
INT64 blksz, tag;
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 63, 5), 5);
new = Heap_NEWREC((address)&blksz);
tag = ((int64)(address)new + blksz) - 24;
__PUT(tag - 8, 0, int64);
__PUT(tag, blksz, int64);
__PUT(tag + 8, -8, int64);
__PUT((int64)(address)new - 8, tag, int64);
tag = ((INT64)(address)new + blksz) - 24;
__PUT(tag - 8, 0, INT64);
__PUT(tag, blksz, INT64);
__PUT(tag + 8, -8, INT64);
__PUT((INT64)(address)new - 8, tag, INT64);
Heap_Unlock();
return new;
}
static void Heap_Mark (int64 q)
static void Heap_Mark (INT64 q)
{
int64 p, tag, offset, fld, n, tagbits;
INT64 p, tag, offset, fld, n, tagbits;
if (q != 0) {
__GET(q - 8, tagbits, int64);
__GET(q - 8, tagbits, INT64);
if (!__ODD(tagbits)) {
__PUT(q - 8, tagbits + 1, int64);
__PUT(q - 8, tagbits + 1, INT64);
p = 0;
tag = tagbits + 8;
for (;;) {
__GET(tag, offset, int64);
__GET(tag, offset, INT64);
if (offset < 0) {
__PUT(q - 8, (tag + offset) + 1, int64);
__PUT(q - 8, (tag + offset) + 1, INT64);
if (p == 0) {
break;
}
n = q;
q = p;
__GET(q - 8, tag, int64);
__GET(q - 8, tag, INT64);
tag -= 1;
__GET(tag, offset, int64);
__GET(tag, offset, INT64);
fld = q + offset;
__GET(fld, p, int64);
__GET(fld, p, INT64);
__PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR);
} else {
fld = q + offset;
__GET(fld, n, int64);
__GET(fld, n, INT64);
if (n != 0) {
__GET(n - 8, tagbits, int64);
__GET(n - 8, tagbits, INT64);
if (!__ODD(tagbits)) {
__PUT(n - 8, tagbits + 1, int64);
__PUT(q - 8, tag + 1, int64);
__PUT(n - 8, tagbits + 1, INT64);
__PUT(q - 8, tag + 1, INT64);
__PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR);
p = q;
q = n;
@ -379,12 +379,12 @@ static void Heap_Mark (int64 q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((int64)(address)p);
Heap_Mark((INT64)(address)p);
}
static void Heap_Scan (void)
{
int64 chnk, adr, end, start, tag, i, size, freesize;
INT64 chnk, adr, end, start, tag, i, size, freesize;
Heap_bigBlocks = 0;
i = 1;
while (i < 9) {
@ -396,58 +396,58 @@ static void Heap_Scan (void)
chnk = Heap_heap;
while (chnk != 0) {
adr = chnk + 24;
__GET(chnk + 8, end, int64);
__GET(chnk + 8, end, INT64);
while (adr < end) {
__GET(adr, tag, int64);
__GET(adr, tag, INT64);
if (__ODD(tag)) {
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 8, int64);
__PUT(start + 8, freesize, int64);
__PUT(start + 16, -8, int64);
__PUT(start, start + 8, INT64);
__PUT(start + 8, freesize, INT64);
__PUT(start + 16, -8, INT64);
i = __ASHR(freesize, 5);
freesize = 0;
if (i < 9) {
__PUT(start + 24, Heap_freeList[i], int64);
__PUT(start + 24, Heap_freeList[i], INT64);
Heap_freeList[i] = start;
} else {
__PUT(start + 24, Heap_bigBlocks, int64);
__PUT(start + 24, Heap_bigBlocks, INT64);
Heap_bigBlocks = start;
}
}
tag -= 1;
__PUT(adr, tag, int64);
__GET(tag, size, int64);
__PUT(adr, tag, INT64);
__GET(tag, size, INT64);
Heap_allocated += size;
adr += size;
} else {
__GET(tag, size, int64);
__GET(tag, size, INT64);
freesize += size;
adr += size;
}
}
if (freesize > 0) {
start = adr - freesize;
__PUT(start, start + 8, int64);
__PUT(start + 8, freesize, int64);
__PUT(start + 16, -8, int64);
__PUT(start, start + 8, INT64);
__PUT(start + 8, freesize, INT64);
__PUT(start + 16, -8, INT64);
i = __ASHR(freesize, 5);
freesize = 0;
if (i < 9) {
__PUT(start + 24, Heap_freeList[i], int64);
__PUT(start + 24, Heap_freeList[i], INT64);
Heap_freeList[i] = start;
} else {
__PUT(start + 24, Heap_bigBlocks, int64);
__PUT(start + 24, Heap_bigBlocks, INT64);
Heap_bigBlocks = start;
}
}
__GET(chnk, chnk, int64);
__GET(chnk, chnk, INT64);
}
}
static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len)
static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len)
{
int64 i, j, x;
INT64 i, j, x;
j = l;
x = a[j];
for (;;) {
@ -464,9 +464,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len)
a[i] = x;
}
static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len)
static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len)
{
int64 l, r, x;
INT64 l, r, x;
l = __ASHR(n, 1);
r = n - 1;
while (l > 0) {
@ -482,25 +482,25 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len)
}
}
static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len)
static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len)
{
int64 chnk, adr, tag, next, lim, lim1, i, ptr, size;
INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size;
chnk = Heap_heap;
i = 0;
lim = cand[n - 1];
while ((chnk != 0 && chnk < lim)) {
adr = chnk + 24;
__GET(chnk + 8, lim1, int64);
__GET(chnk + 8, lim1, INT64);
if (lim < lim1) {
lim1 = lim;
}
while (adr < lim1) {
__GET(adr, tag, int64);
__GET(adr, tag, INT64);
if (__ODD(tag)) {
__GET(tag - 1, size, int64);
__GET(tag - 1, size, INT64);
adr += size;
} else {
__GET(tag, size, int64);
__GET(tag, size, INT64);
ptr = adr + 8;
while (cand[i] < ptr) {
i += 1;
@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len)
adr = next;
}
}
__GET(chnk, chnk, int64);
__GET(chnk, chnk, INT64);
}
}
static void Heap_CheckFin (void)
{
Heap_FinNode n;
int64 tag;
INT64 tag;
n = Heap_fin;
while (n != NIL) {
__GET(n->obj - 8, tag, int64);
__GET(n->obj - 8, tag, INT64);
if (!__ODD(tag)) {
n->marked = 0;
Heap_Mark(n->obj);
@ -571,10 +571,10 @@ void Heap_FINALL (void)
}
}
static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len)
static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len)
{
SYSTEM_PTR frame;
int64 inc, nofcand, sp, p, stack0;
INT64 inc, nofcand, sp, p, stack0;
struct Heap__1 align;
if (n > 0) {
Heap_MarkStack(n - 1, cand, cand__len);
@ -591,9 +591,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len)
inc = -inc;
}
while (sp != stack0) {
__GET(sp, p, int64);
__GET(sp, p, INT64);
if ((p > Heap_heap && p < Heap_heapend)) {
if (nofcand == (int64)cand__len) {
if (nofcand == (INT64)cand__len) {
Heap_HeapSort(nofcand, (void*)cand, cand__len);
Heap_MarkCandidates(nofcand, (void*)cand, cand__len);
nofcand = 0;
@ -613,8 +613,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len)
void Heap_GC (BOOLEAN markStack)
{
Heap_Module m;
int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
int64 cand[10000];
INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23;
INT64 cand[10000];
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
Heap_Lock();
m = (Heap_Module)(address)Heap_modules;
@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (int64)(address)obj;
f->obj = (INT64)(address)obj;
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;
@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
void Heap_InitHeap (void)
{
Heap_heap = Heap_NewChunk(256000);
__GET(Heap_heap + 8, Heap_heapend, int64);
__PUT(Heap_heap, 0, int64);
__GET(Heap_heap + 8, Heap_heapend, INT64);
__PUT(Heap_heap, 0, INT64);
Heap_allocated = 0;
Heap_firstTry = 1;
Heap_freeList[9] = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#ifndef Heap__h
#define Heap__h
@ -22,7 +22,7 @@ typedef
typedef
struct Heap_ModuleDesc {
int64 _prvt0;
INT64 _prvt0;
char _prvt1[56];
} Heap_ModuleDesc;
@ -31,21 +31,21 @@ typedef
import SYSTEM_PTR Heap_modules;
import int64 Heap_allocated, Heap_heapsize;
import int16 Heap_FileCount;
import INT64 Heap_allocated, Heap_heapsize;
import INT16 Heap_FileCount;
import address *Heap_ModuleDesc__typ;
import ADDRESS *Heap_ModuleDesc__typ;
import void Heap_FINALL (void);
import void Heap_GC (BOOLEAN markStack);
import void Heap_INCREF (Heap_Module m);
import void Heap_InitHeap (void);
import void Heap_Lock (void);
import SYSTEM_PTR Heap_NEWBLK (int64 size);
import SYSTEM_PTR Heap_NEWREC (int64 tag);
import SYSTEM_PTR Heap_NEWBLK (INT64 size);
import SYSTEM_PTR Heap_NEWREC (INT64 tag);
import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd);
import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs);
import void Heap_REGTYP (Heap_Module m, int64 typ);
import void Heap_REGTYP (Heap_Module m, INT64 typ);
import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize);
import void Heap_Unlock (void);
import void *Heap__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Heap.h"
@ -31,20 +31,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
int32 reserved1, reserved2;
INT32 types;
void (*enumPtrs)(void(*)(INT32));
INT32 reserved1, reserved2;
} Modules_ModuleDesc;
export int16 Modules_res;
export INT16 Modules_res;
export CHAR Modules_resMsg[256];
export Modules_ModuleName Modules_imported, Modules_importing;
export address *Modules_ModuleDesc__typ;
export address *Modules_CmdDesc__typ;
export ADDRESS *Modules_ModuleDesc__typ;
export ADDRESS *Modules_CmdDesc__typ;
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len);
export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len)
{
int16 i, j;
INT16 i, j;
__DUP(b, b__len, CHAR);
i = 0;
while (a[__X(i, a__len)] != 0x00) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Modules__h
#define Modules__h
@ -28,20 +28,20 @@ typedef
struct Modules_ModuleDesc {
Modules_Module next;
Modules_ModuleName name;
int32 refcnt;
INT32 refcnt;
Modules_Cmd cmds;
int32 types;
void (*enumPtrs)(void(*)(int32));
INT32 types;
void (*enumPtrs)(void(*)(INT32));
char _prvt0[8];
} Modules_ModuleDesc;
import int16 Modules_res;
import INT16 Modules_res;
import CHAR Modules_resMsg[256];
import Modules_ModuleName Modules_imported, Modules_importing;
import address *Modules_ModuleDesc__typ;
import address *Modules_CmdDesc__typ;
import ADDRESS *Modules_ModuleDesc__typ;
import ADDRESS *Modules_CmdDesc__typ;
import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -11,13 +11,13 @@
#include "OPT.h"
static int16 OPB_exp;
static int64 OPB_maxExp;
static INT16 OPB_exp;
static INT64 OPB_maxExp;
export void OPB_Assign (OPT_Node *x, OPT_Node y);
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static int16 OPB_BoolToInt (BOOLEAN b);
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static INT16 OPB_BoolToInt (BOOLEAN b);
export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
static void OPB_CharToString (OPT_Node n);
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode);
@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo);
export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
static void OPB_CheckProc (OPT_Struct x, OPT_Object y);
static void OPB_CheckPtr (OPT_Node x, OPT_Node y);
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x);
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x);
static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp);
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y);
export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
static void OPB_Convert (OPT_Node *x, OPT_Struct typ);
export void OPB_DeRef (OPT_Node *x);
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar);
@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y);
export void OPB_In (OPT_Node *x, OPT_Node y);
export void OPB_Index (OPT_Node *x, OPT_Node y);
export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
static BOOLEAN OPB_IntToBool (int64 i);
static BOOLEAN OPB_IntToBool (INT64 i);
export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
export void OPB_MOp (int8 op, OPT_Node *x);
export void OPB_MOp (INT8 op, OPT_Node *x);
export OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
export OPT_Node OPB_NewIntConst (int64 intval);
export OPT_Node OPB_NewIntConst (INT64 intval);
export OPT_Node OPB_NewLeaf (OPT_Object obj);
export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
export OPT_Node OPB_NewString (OPS_String str, int64 len);
export OPT_Node OPB_NewString (OPS_String str, INT64 len);
export OPT_Node OPB_Nil (void);
static BOOLEAN OPB_NotVar (OPT_Node x);
export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
export void OPB_OptIf (OPT_Node *x);
export void OPB_Param (OPT_Node ap, OPT_Object fp);
export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x);
static void OPB_SetIntType (OPT_Node node);
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
static void OPB_SetSetType (OPT_Node node);
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
export void OPB_StaticLink (int8 dlev);
export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
export void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
export void OPB_StaticLink (INT8 dlev);
export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
static void OPB_err (int16 n);
static int64 OPB_log (int64 x);
static void OPB_err (INT16 n);
static INT64 OPB_log (INT64 x);
static void OPB_err (int16 n)
static void OPB_err (INT16 n)
{
OPM_err(n);
}
@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj)
return node;
}
void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y)
void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y)
*last = y;
}
static int16 OPB_BoolToInt (BOOLEAN b)
static INT16 OPB_BoolToInt (BOOLEAN b)
{
if (b) {
return 1;
@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b)
__RETCHK;
}
static BOOLEAN OPB_IntToBool (int64 i)
static BOOLEAN OPB_IntToBool (INT64 i)
{
return i != 0;
}
@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node)
static void OPB_SetSetType (OPT_Node node)
{
int32 i32;
__GET((address)&node->conval->setval + 4, i32, int32);
INT32 i32;
__GET((address)&node->conval->setval + 4, i32, INT32);
if (i32 == 0) {
node->typ = OPT_set32typ;
} else {
@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node)
}
}
OPT_Node OPB_NewIntConst (int64 intval)
OPT_Node OPB_NewIntConst (INT64 intval)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ)
return x;
}
OPT_Node OPB_NewString (OPS_String str, int64 len)
OPT_Node OPB_NewString (OPS_String str, INT64 len)
{
OPT_Node x = NIL;
x = OPT_NewNode(7);
@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n)
n->obj = NIL;
}
static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x)
void OPB_Index (OPT_Node *x, OPT_Node y)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
f = y->typ->form;
if ((*x)->class >= 7) {
@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
}
if ((*x)->typ->comp == 2) {
typ = (*x)->typ->BaseTyp;
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) {
if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) {
OPB_err(81);
}
} else if ((*x)->typ->comp == 3) {
@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
void OPB_In (OPT_Node *x, OPT_Node y)
{
int16 f;
int64 k;
INT16 f;
INT64 k;
f = (*x)->typ->form;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if ((f == 4 && y->typ->form == 7)) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) {
if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64));
@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
(*x)->typ = OPT_booltyp;
}
static int64 OPB_log (int64 x)
static INT64 OPB_log (INT64 x)
{
OPB_exp = 0;
if (x > 0) {
@ -478,7 +478,7 @@ static int64 OPB_log (int64 x)
return x;
}
static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x)
static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x)
{
LONGREAL min, max, r;
if (f == 5) {
@ -502,9 +502,9 @@ static struct MOp__28 {
struct MOp__28 *lnk;
} *MOp__28_s;
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z);
static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z)
{
OPT_Node node = NIL;
node = OPT_NewNode(11);
@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z)
return node;
}
void OPB_MOp (int8 op, OPT_Node *x)
void OPB_MOp (INT8 op, OPT_Node *x)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node z = NIL;
struct MOp__28 _s;
@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int16)__CAP((CHAR)z->conval->intval);
z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x)
static void OPB_CheckPtr (OPT_Node x, OPT_Node y)
{
int16 g;
INT16 g;
OPT_Struct p = NIL, q = NIL, t = NIL;
g = y->typ->form;
if (g == 11) {
@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y)
static struct ConstOp__13 {
OPT_Node *x;
int16 *f;
INT16 *f;
OPT_Const *xval, *yval;
struct ConstOp__13 *lnk;
} *ConstOp__13_s;
static int16 ConstCmp__14 (void);
static INT16 ConstCmp__14 (void);
static int16 ConstCmp__14 (void)
static INT16 ConstCmp__14 (void)
{
int16 res;
INT16 res;
switch (*ConstOp__13_s->f) {
case 0:
res = 9;
@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void)
return res;
}
static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Const xval = NIL, yval = NIL;
int64 xv, yv;
INT64 xv, yv;
BOOLEAN temp;
struct ConstOp__13 _s;
_s.x = &x;
@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y)
static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
{
OPT_Node node = NIL;
int16 f, g;
int64 k;
INT16 f, g;
INT64 k;
LONGREAL r;
f = (*x)->typ->form;
g = typ->form;
@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
OPB_err(203);
r = (LONGREAL)1;
}
(*x)->conval->intval = (int32)__ENTIER(r);
(*x)->conval->intval = (INT32)__ENTIER(r);
OPB_SetIntType(*x);
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
}
static struct Op__38 {
int16 *f, *g;
INT16 *f, *g;
struct Op__38 *lnk;
} *Op__38_s;
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y);
static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y);
static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y)
{
OPT_Node node = NIL;
node = OPT_NewNode(12);
@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
return ok;
}
void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y)
{
int16 f, g;
INT16 f, g;
OPT_Node t = NIL, z = NIL;
OPT_Struct typ = NIL;
BOOLEAN do_;
int64 val;
INT64 val;
struct Op__38 _s;
_s.f = &f;
_s.g = &g;
@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
void OPB_SetRange (OPT_Node *x, OPT_Node y)
{
int64 k, l;
INT64 k, l;
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
OPB_err(126);
} else if (((*x)->typ->form == 4 && y->typ->form == 4)) {
@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
void OPB_SetElem (OPT_Node *x)
{
int64 k;
INT64 k;
if ((*x)->class == 8 || (*x)->class == 9) {
OPB_err(126);
} else if ((*x)->typ->form != 4) {
@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x)
static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
{
OPT_Struct y = NIL;
int16 f, g;
INT16 f, g;
OPT_Struct p = NIL, q = NIL;
y = ynode->typ;
f = x->form;
@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo)
{
}
void OPB_StPar0 (OPT_Node *par0, int16 fctno)
void OPB_StPar0 (OPT_Node *par0, INT16 fctno)
{
int16 f;
INT16 f;
OPT_Struct typ = NIL;
OPT_Node x = NIL;
x = *par0;
@ -1983,9 +1983,9 @@ static struct StPar1__53 {
struct StPar1__53 *lnk;
} *StPar1__53_s;
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right);
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right)
{
OPT_Node node = NIL;
node = OPT_NewNode(class);
@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right
return node;
}
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno)
{
int16 f, L;
INT16 f, L;
OPT_Struct typ = NIL;
OPT_Node p = NIL, t = NIL;
struct StPar1__53 _s;
@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (f == 4) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) {
OPB_err(202);
}
p = NewOp__54(19, fctno, p, x);
@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(208);
p->conval->intval = 1;
} else if (x->conval->intval >= 0) {
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval);
if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) {
p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval);
} else {
OPB_err(208);
p->conval->intval = 1;
@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
StPar1__53_s = _s.lnk;
}
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n)
{
OPT_Node node = NIL;
int16 f;
INT16 f;
OPT_Node p = NIL;
p = *par0;
f = x->typ->form;
@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
*par0 = p;
}
void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno)
{
int16 dim;
INT16 dim;
OPT_Node x = NIL, p = NIL;
p = *par0;
if (fctno <= 19) {
@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno)
static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar)
{
int16 f;
INT16 f;
f = atyp->comp;
ftyp = ftyp->BaseTyp;
atyp = atyp->BaseTyp;
@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
}
}
void OPB_StaticLink (int8 dlev)
void OPB_StaticLink (INT8 dlev)
{
OPT_Object scope = NIL;
scope = OPT_topScope;
@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp)
{
OPT_Struct typ = NIL;
OPT_Node p = NIL;
int8 lev;
INT8 lev;
if ((*x)->class == 9) {
typ = (*x)->typ;
lev = (*x)->obj->mnolev;
@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc)
void OPB_Assign (OPT_Node *x, OPT_Node y)
{
OPT_Node z = NIL;
int8 subcl;
INT8 subcl;
if ((*x)->class >= 7) {
OPB_err(56);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPB__h
#define OPB__h
@ -13,7 +13,7 @@
import void OPB_Assign (OPT_Node *x, OPT_Node y);
import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp);
import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames);
import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y);
import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y);
import void OPB_DeRef (OPT_Node *x);
import OPT_Node OPB_EmptySet (void);
import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc);
@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y);
import void OPB_Index (OPT_Node *x, OPT_Node y);
import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ);
import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y);
import void OPB_MOp (int8 op, OPT_Node *x);
import void OPB_MOp (INT8 op, OPT_Node *x);
import OPT_Node OPB_NewBoolConst (BOOLEAN boolval);
import OPT_Node OPB_NewIntConst (int64 intval);
import OPT_Node OPB_NewIntConst (INT64 intval);
import OPT_Node OPB_NewLeaf (OPT_Object obj);
import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ);
import OPT_Node OPB_NewString (OPS_String str, int64 len);
import OPT_Node OPB_NewString (OPS_String str, INT64 len);
import OPT_Node OPB_Nil (void);
import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y);
import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y);
import void OPB_OptIf (OPT_Node *x);
import void OPB_Param (OPT_Node ap, OPT_Object fp);
import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar);
import void OPB_Return (OPT_Node *x, OPT_Object proc);
import void OPB_SetElem (OPT_Node *x);
import void OPB_SetRange (OPT_Node *x, OPT_Node y);
import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
import void OPB_StPar0 (OPT_Node *par0, int16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n);
import void OPB_StaticLink (int8 dlev);
import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno);
import void OPB_StPar0 (OPT_Node *par0, INT16 fctno);
import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno);
import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n);
import void OPB_StaticLink (INT8 dlev);
import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard);
import void *OPB__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -11,9 +11,9 @@
#include "OPT.h"
static int16 OPC_indentLevel;
static int8 OPC_hashtab[105];
static CHAR OPC_keytab[50][9];
static INT16 OPC_indentLevel;
static INT8 OPC_hashtab[105];
static CHAR OPC_keytab[60][9];
static BOOLEAN OPC_GlbPtrs;
static CHAR OPC_BodyNameExt[13];
@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames);
export OPT_Object OPC_BaseTProc (OPT_Object obj);
export void OPC_BegBlk (void);
export void OPC_BegStat (void);
static void OPC_CProcDefs (OPT_Object obj, int16 vis);
export void OPC_Case (int64 caseVal, int16 form);
static void OPC_CharacterLiteral (int64 c);
export void OPC_Cmp (int16 rel);
static void OPC_CProcDefs (OPT_Object obj, INT16 vis);
export void OPC_Case (INT64 caseVal, INT16 form);
static void OPC_CharacterLiteral (INT64 c);
export void OPC_Cmp (INT16 rel);
export void OPC_CompleteIdent (OPT_Object obj);
export void OPC_Constant (OPT_Const con, int16 form);
export void OPC_Constant (OPT_Const con, INT16 form);
static void OPC_DeclareBase (OPT_Object dcl);
static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef);
static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro);
@ -45,45 +45,45 @@ export void OPC_EnterBody (void);
export void OPC_EnterProc (OPT_Object proc);
export void OPC_ExitBody (void);
export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign);
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign);
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign);
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign);
export void OPC_GenBdy (OPT_Node n);
static void OPC_GenDynTypes (OPT_Node n, int16 vis);
static void OPC_GenDynTypes (OPT_Node n, INT16 vis);
export void OPC_GenEnumPtrs (OPT_Object var);
export void OPC_GenHdr (OPT_Node n);
export void OPC_GenHdrIncludes (void);
static void OPC_GenHeaderMsg (void);
export void OPC_Halt (int32 n);
export void OPC_Halt (INT32 n);
export void OPC_Ident (OPT_Object obj);
static void OPC_IdentList (OPT_Object obj, int16 vis);
static void OPC_IdentList (OPT_Object obj, INT16 vis);
static void OPC_Include (CHAR *name, LONGINT name__len);
static void OPC_IncludeImports (OPT_Object obj, int16 vis);
static void OPC_IncludeImports (OPT_Object obj, INT16 vis);
export void OPC_Increment (BOOLEAN decrement);
export void OPC_Indent (int16 count);
export void OPC_Indent (INT16 count);
export void OPC_Init (void);
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 (int64 n, int32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
export void OPC_IntLiteral (INT64 n, INT32 size);
export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName);
static int16 OPC_Length (CHAR *s, LONGINT s__len);
static INT16 OPC_Length (CHAR *s, LONGINT s__len);
export BOOLEAN OPC_NeedsRetval (OPT_Object proc);
export int32 OPC_NofPtrs (OPT_Struct typ);
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
export INT32 OPC_NofPtrs (OPT_Struct typ);
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len);
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len);
static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define);
static void OPC_ProcPredefs (OPT_Object obj, int8 vis);
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis);
static void OPC_PutBase (OPT_Struct typ);
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt);
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt);
static void OPC_RegCmds (OPT_Object obj);
export void OPC_SetInclude (BOOLEAN exclude);
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause);
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l);
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x);
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l);
export void OPC_TDescDecl (OPT_Struct typ);
export void OPC_TypeDefs (OPT_Object obj, int16 vis);
export void OPC_TypeDefs (OPT_Object obj, INT16 vis);
export void OPC_TypeOf (OPT_Object ap);
static BOOLEAN OPC_Undefined (OPT_Object obj);
@ -94,14 +94,14 @@ void OPC_Init (void)
__MOVE("__init(void)", OPC_BodyNameExt, 13);
}
void OPC_Indent (int16 count)
void OPC_Indent (INT16 count)
{
OPC_indentLevel += count;
}
void OPC_BegStat (void)
{
int16 i;
INT16 i;
i = OPC_indentLevel;
while (i > 0) {
OPM_Write(0x09);
@ -137,10 +137,10 @@ void OPC_EndBlk0 (void)
OPM_Write('}');
}
static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x)
{
CHAR ch;
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
ch = s[0];
i = 0;
@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x)
__DEL(s);
}
static int16 OPC_Length (CHAR *s, LONGINT s__len)
static INT16 OPC_Length (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len)
return i;
}
static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
{
int16 i, h;
INT16 i, h;
i = 0;
h = 0;
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
h = 3 * h + (int16)s[__X(i, s__len)];
h = 3 * h + (INT16)s[__X(i, s__len)];
i += 1;
}
return (int)__MOD(h, 105);
@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len)
void OPC_Ident (OPT_Object obj)
{
int16 mode, level, h;
INT16 mode, level, h;
mode = obj->mode;
level = obj->mnolev;
if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) {
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)], 50)], obj->name) == 0) {
if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) {
OPM_Write('_');
}
}
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
if (obj->typ == OPT_adrtyp) {
OPM_WriteString((CHAR*)"address", 8);
OPM_WriteString((CHAR*)"ADDRESS", 8);
} else {
if (obj->typ->form == 4) {
OPM_WriteString((CHAR*)"int", 4);
OPM_WriteString((CHAR*)"INT", 4);
} else {
OPM_WriteString((CHAR*)"uint", 5);
OPM_WriteString((CHAR*)"UINT", 5);
}
OPM_WriteInt(__ASHL(obj->typ->size, 3));
}
@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj)
static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause)
{
int16 pointers;
INT16 pointers;
*openClause = 0;
if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) {
if (__IN(typ->comp, 0x0c, 32)) {
@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
{
OPT_Struct typ = NIL;
BOOLEAN varPar, openClause;
int16 form, comp;
INT16 form, comp;
typ = dcl->typ;
varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef;
OPC_Stars(typ, &openClause);
@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl)
{
OPT_Struct typ = NIL, prev = NIL;
OPT_Object obj = NIL;
int16 nofdims;
int32 off, n, dummy;
INT16 nofdims;
INT32 off, n, dummy;
typ = dcl->typ;
prev = typ;
while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) {
@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl)
}
}
int32 OPC_NofPtrs (OPT_Struct typ)
INT32 OPC_NofPtrs (OPT_Struct typ)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n;
INT32 n;
if ((typ->form == 11 && typ->sysflag == 0)) {
return 1;
} else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) {
@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ)
__RETCHK;
}
static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt)
static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt)
{
OPT_Object fld = NIL;
OPT_Struct btyp = NIL;
int32 n, i;
INT32 n, i;
if ((typ->form == 11 && typ->sysflag == 0)) {
OPM_WriteInt(adr);
OPM_WriteString((CHAR*)", ", 3);
@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ)
static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName)
{
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (showParamName) {
OPC_Ident(par);
OPM_WriteString((CHAR*)"__len", 6);
@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty)
OPT_Object OPC_BaseTProc (OPT_Object obj)
{
OPT_Struct typ = NIL, base = NIL;
int32 mno;
INT32 mno;
typ = obj->link->typ;
if (typ->form == 11) {
typ = typ->BaseTyp;
@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str)
static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
{
int16 i;
INT16 i;
__DUP(y, y__len, CHAR);
i = 0;
while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) {
@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len)
return y[__X(i, y__len)] == 0x00;
}
static void OPC_CProcDefs (OPT_Object obj, int16 vis)
static void OPC_CProcDefs (OPT_Object obj, INT16 vis)
{
int16 i;
INT16 i;
OPT_ConstExt ext = NIL;
int16 _for__7;
INT16 _for__7;
if (obj != NIL) {
OPC_CProcDefs(obj->left, vis);
if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) {
if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) {
ext = obj->conval->ext;
i = 1;
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
OPC_DeclareParams(obj->link, 1);
OPM_Write(0x09);
}
_for__7 = (int16)(*obj->conval->ext)[0];
_for__7 = (INT16)(*obj->conval->ext)[0];
i = i;
while (i <= _for__7) {
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis)
}
}
void OPC_TypeDefs (OPT_Object obj, int16 vis)
void OPC_TypeDefs (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_TypeDefs(obj->left, vis);
@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n)
void OPC_TDescDecl (OPT_Struct typ)
{
int32 nofptrs;
INT32 nofptrs;
OPT_Object o = NIL;
OPC_BegStat();
OPM_WriteString((CHAR*)"__TDESC(", 9);
@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ)
}
}
static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign)
static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign)
{
int32 adr;
INT32 adr;
adr = off;
OPT_Align(&adr, align);
if ((*curAlign < align && gap - (adr - off) >= align)) {
@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
OPC_BegStat();
switch (align) {
case 2:
OPM_WriteString((CHAR*)"int16", 6);
OPM_WriteString((CHAR*)"INT16", 6);
break;
case 4:
OPM_WriteString((CHAR*)"int32", 6);
OPM_WriteString((CHAR*)"INT32", 6);
break;
case 8:
OPM_WriteString((CHAR*)"int64", 6);
OPM_WriteString((CHAR*)"INT64", 6);
break;
default:
OPM_LogWLn();
@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur
}
}
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign)
static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign)
{
OPT_Object fld = NIL;
OPT_Struct base = NIL;
int32 gap, adr, align, fldAlign;
INT32 gap, adr, align, fldAlign;
fld = typ->link;
align = __MASK(typ->align, -65536);
if (typ->BaseTyp != NIL) {
@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i
}
}
static void OPC_IdentList (OPT_Object obj, int16 vis)
static void OPC_IdentList (OPT_Object obj, INT16 vis)
{
OPT_Struct base = NIL;
BOOLEAN first;
int16 lastvis;
INT16 lastvis;
base = NIL;
first = 1;
while ((obj != NIL && obj->mode != 13)) {
if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
if (obj->typ != base || (int16)obj->vis != lastvis) {
if (obj->typ != base || (INT16)obj->vis != lastvis) {
if (!first) {
OPC_EndStat();
}
@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis)
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPC_EndStat();
OPC_BegStat();
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
base = NIL;
@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames)
OPM_WriteString((CHAR*)", LONGINT ", 11);
OPC_LenList(obj, 1, showParamNames);
} else if ((obj->mode == 2 && obj->typ->comp == 4)) {
OPM_WriteString((CHAR*)", address *", 12);
OPM_WriteString((CHAR*)", ADDRESS *", 12);
if (showParamNames) {
OPC_Ident(obj);
OPM_WriteString((CHAR*)"__typ", 6);
@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
OPM_WriteLn();
}
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
static void OPC_ProcPredefs (OPT_Object obj, INT8 vis)
{
if (obj != NIL) {
OPC_ProcPredefs(obj->left, vis);
@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len)
__DEL(name);
}
static void OPC_IncludeImports (OPT_Object obj, int16 vis)
static void OPC_IncludeImports (OPT_Object obj, INT16 vis)
{
if (obj != NIL) {
OPC_IncludeImports(obj->left, vis);
if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) {
OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
}
OPC_IncludeImports(obj->right, vis);
}
}
static void OPC_GenDynTypes (OPT_Node n, int16 vis)
static void OPC_GenDynTypes (OPT_Node n, INT16 vis)
{
OPT_Struct typ = NIL;
while ((n != NIL && n->class == 14)) {
@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis)
} else {
OPM_WriteString((CHAR*)"export ", 8);
}
OPM_WriteString((CHAR*)"address *", 10);
OPM_WriteString((CHAR*)"ADDRESS *", 10);
OPC_Andent(typ);
OPM_WriteString((CHAR*)"__typ", 6);
OPC_EndStat();
@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n)
static void OPC_GenHeaderMsg (void)
{
int16 i;
INT16 i;
OPM_WriteString((CHAR*)"/* ", 4);
OPM_WriteString((CHAR*)"voc", 4);
OPM_Write(' ');
@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n)
OPM_currFile = 1;
OPC_GenHeaderMsg();
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
OPM_WriteString((CHAR*)"#define SHORTINT INT", 21);
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
OPM_WriteString((CHAR*)"#define INTEGER INT", 21);
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
OPM_WriteString((CHAR*)"#define LONGINT INT", 21);
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
OPM_WriteLn();
OPM_WriteString((CHAR*)"#define SET uint", 22);
OPM_WriteString((CHAR*)"#define SET UINT", 22);
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
OPM_WriteLn();
OPM_WriteLn();
@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj)
void OPC_GenEnumPtrs (OPT_Object var)
{
OPT_Struct typ = NIL;
int32 n;
INT32 n;
OPC_GlbPtrs = 0;
while (var != NIL) {
typ = var->typ;
@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc)
{
OPT_Object var = NIL, scope = NIL;
OPT_Struct typ = NIL;
int16 dim;
INT16 dim;
if (proc->vis != 1) {
OPM_WriteString((CHAR*)"static ", 8);
}
@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet)
void OPC_CompleteIdent (OPT_Object obj)
{
int16 comp, level;
INT16 comp, level;
level = obj->mnolev;
if (obj->adr == 1) {
if (obj->typ->comp == 4) {
@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj)
void OPC_TypeOf (OPT_Object ap)
{
int16 i;
INT16 i;
__ASSERT(ap->typ->comp == 4, 0);
if (ap->mode == 2) {
if ((int16)ap->mnolev != OPM_level) {
if ((INT16)ap->mnolev != OPM_level) {
OPM_WriteStringVar((void*)ap->scope->name, 256);
OPM_WriteString((CHAR*)"_s->", 5);
OPC_Ident(ap);
@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap)
}
}
void OPC_Cmp (int16 rel)
void OPC_Cmp (INT16 rel)
{
switch (rel) {
case 9:
@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel)
}
}
static void OPC_CharacterLiteral (int64 c)
static void OPC_CharacterLiteral (INT64 c)
{
if (c < 32 || c > 126) {
OPM_WriteString((CHAR*)"0x", 3);
@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c)
}
}
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l)
{
int32 i;
int16 c;
INT32 i;
INT16 c;
__DUP(s, s__len, CHAR);
OPM_Write('"');
i = 0;
while (i < l) {
c = (int16)s[__X(i, s__len)];
c = (INT16)s[__X(i, s__len)];
if (c < 32 || c > 126) {
OPM_Write('\\');
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l)
__DEL(s);
}
void OPC_Case (int64 caseVal, int16 form)
void OPC_Case (INT64 caseVal, INT16 form)
{
CHAR ch;
OPM_WriteString((CHAR*)"case ", 6);
@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement)
}
}
void OPC_Halt (int32 n)
void OPC_Halt (INT32 n)
{
OPC_Str1((CHAR*)"__HALT(#)", 10, n);
}
void OPC_IntLiteral (int64 n, int32 size)
void OPC_IntLiteral (INT64 n, INT32 size)
{
if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) {
OPM_WriteString((CHAR*)"((int", 6);
OPM_WriteString((CHAR*)"((INT", 6);
OPM_WriteInt(__ASHL(size, 3));
OPM_WriteString((CHAR*)")(", 3);
OPM_WriteInt(n);
@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size)
}
}
void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim)
{
if (array->comp == 3) {
OPC_CompleteIdent(obj);
@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
}
}
void OPC_Constant (OPT_Const con, int16 form)
void OPC_Constant (OPT_Const con, INT16 form)
{
int16 i;
uint64 s;
int64 hex;
INT16 i;
UINT64 s;
INT64 hex;
BOOLEAN skipLeading;
switch (form) {
case 1:
@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form)
}
static struct InitKeywords__46 {
int8 *n;
INT8 *n;
struct InitKeywords__46 *lnk;
} *InitKeywords__46_s;
@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len);
static void Enter__47 (CHAR *s, LONGINT s__len)
{
int16 h;
INT16 h;
__DUP(s, s__len, CHAR);
h = OPC_PerfectHash((void*)s, s__len);
OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n;
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9);
__COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9);
*InitKeywords__46_s->n += 1;
__DEL(s);
}
static void OPC_InitKeywords (void)
{
int8 n, i;
INT8 n, i;
struct InitKeywords__46 _s;
_s.n = &n;
_s.lnk = InitKeywords__46_s;
@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void)
OPC_hashtab[__X(i, 105)] = -1;
i += 1;
}
Enter__47((CHAR*)"ADDRESS", 8);
Enter__47((CHAR*)"INT16", 6);
Enter__47((CHAR*)"INT32", 6);
Enter__47((CHAR*)"INT64", 6);
Enter__47((CHAR*)"INT8", 5);
Enter__47((CHAR*)"UINT16", 7);
Enter__47((CHAR*)"UINT32", 7);
Enter__47((CHAR*)"UINT64", 7);
Enter__47((CHAR*)"UINT8", 6);
Enter__47((CHAR*)"address", 8);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"asm", 4);
Enter__47((CHAR*)"auto", 5);
Enter__47((CHAR*)"break", 6);
@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"if", 3);
Enter__47((CHAR*)"import", 7);
Enter__47((CHAR*)"int", 4);
Enter__47((CHAR*)"int16", 6);
Enter__47((CHAR*)"int32", 6);
Enter__47((CHAR*)"int64", 6);
Enter__47((CHAR*)"int8", 5);
Enter__47((CHAR*)"long", 5);
Enter__47((CHAR*)"register", 9);
Enter__47((CHAR*)"return", 7);
@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void)
Enter__47((CHAR*)"struct", 7);
Enter__47((CHAR*)"switch", 7);
Enter__47((CHAR*)"typedef", 8);
Enter__47((CHAR*)"uint16", 7);
Enter__47((CHAR*)"uint32", 7);
Enter__47((CHAR*)"uint64", 7);
Enter__47((CHAR*)"uint8", 6);
Enter__47((CHAR*)"union", 6);
Enter__47((CHAR*)"unsigned", 9);
Enter__47((CHAR*)"void", 5);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPC__h
#define OPC__h
@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ);
import OPT_Object OPC_BaseTProc (OPT_Object obj);
import void OPC_BegBlk (void);
import void OPC_BegStat (void);
import void OPC_Case (int64 caseVal, int16 form);
import void OPC_Cmp (int16 rel);
import void OPC_Case (INT64 caseVal, INT16 form);
import void OPC_Cmp (INT16 rel);
import void OPC_CompleteIdent (OPT_Object obj);
import void OPC_Constant (OPT_Const con, int16 form);
import void OPC_Constant (OPT_Const con, INT16 form);
import void OPC_DefineInter (OPT_Object proc);
import void OPC_EndBlk (void);
import void OPC_EndBlk0 (void);
@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n);
import void OPC_GenEnumPtrs (OPT_Object var);
import void OPC_GenHdr (OPT_Node n);
import void OPC_GenHdrIncludes (void);
import void OPC_Halt (int32 n);
import void OPC_Halt (INT32 n);
import void OPC_Ident (OPT_Object obj);
import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (int16 count);
import void OPC_Indent (INT16 count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (int64 n, int32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim);
import void OPC_IntLiteral (INT64 n, INT32 size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim);
import BOOLEAN OPC_NeedsRetval (OPT_Object proc);
import int32 OPC_NofPtrs (OPT_Struct typ);
import INT32 OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);
import void OPC_TDescDecl (OPT_Struct typ);
import void OPC_TypeDefs (OPT_Object obj, int16 vis);
import void OPC_TypeDefs (OPT_Object obj, INT16 vis);
import void OPC_TypeOf (OPT_Object ap);
import void *OPC__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "Configuration.h"
@ -22,81 +22,81 @@ typedef
static CHAR OPM_SourceFileName[256];
static CHAR OPM_GlobalModel[10];
export CHAR OPM_Model[10];
static int16 OPM_GlobalAddressSize;
export int16 OPM_AddressSize;
static int16 OPM_GlobalAlignment;
export int16 OPM_Alignment;
export uint32 OPM_GlobalOptions, OPM_Options;
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export int64 OPM_MaxIndex;
static INT16 OPM_GlobalAddressSize;
export INT16 OPM_AddressSize;
static INT16 OPM_GlobalAlignment;
export INT16 OPM_Alignment;
export UINT32 OPM_GlobalOptions, OPM_Options;
export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
export INT64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr;
export int32 OPM_curpos, OPM_errpos, OPM_breakpc;
export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Writer OPM_W;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
static int16 OPM_S;
static INT16 OPM_S;
export CHAR OPM_ResourceDir[1024];
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F);
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F);
export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void);
export void OPM_DeleteNewSym (void);
export void OPM_FPrint (int32 *fp, int64 val);
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
export void OPM_FPrintReal (int32 *fp, REAL real);
export void OPM_FPrintSet (int32 *fp, uint64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
export void OPM_FPrint (INT32 *fp, INT64 val);
export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
export void OPM_FPrintReal (INT32 *fp, REAL real);
export void OPM_FPrintSet (INT32 *fp, UINT64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
export void OPM_Get (CHAR *ch);
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
export void OPM_InitOptions (void);
export int16 OPM_Integer (int64 n);
static void OPM_LogErrMsg (int16 n);
export INT16 OPM_Integer (INT64 n);
static void OPM_LogErrMsg (INT16 n);
export void OPM_LogW (CHAR ch);
export void OPM_LogWLn (void);
export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWNum (INT64 i, INT64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n);
export INT32 OPM_Longint (INT64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int32 pos);
export void OPM_Mark (INT16 n, INT32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
export BOOLEAN OPM_OpenPar (void);
export void OPM_RegisterNewSym (void);
static void OPM_ScanOptions (CHAR *s, LONGINT s__len);
static void OPM_ShowLine (int64 pos);
export int64 OPM_SignedMaximum (int32 bytecount);
export int64 OPM_SignedMinimum (int32 bytecount);
static void OPM_ShowLine (INT64 pos);
export INT64 OPM_SignedMaximum (INT32 bytecount);
export INT64 OPM_SignedMinimum (INT32 bytecount);
export void OPM_SymRCh (CHAR *ch);
export int32 OPM_SymRInt (void);
export int64 OPM_SymRInt64 (void);
export INT32 OPM_SymRInt (void);
export INT64 OPM_SymRInt64 (void);
export void OPM_SymRLReal (LONGREAL *lr);
export void OPM_SymRReal (REAL *r);
export void OPM_SymRSet (uint64 *s);
export void OPM_SymRSet (UINT64 *s);
export void OPM_SymWCh (CHAR ch);
export void OPM_SymWInt (int64 i);
export void OPM_SymWInt (INT64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (uint64 s);
export void OPM_SymWSet (UINT64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (int64 i);
export void OPM_WriteInt (int64 i);
export void OPM_WriteHex (INT64 i);
export void OPM_WriteInt (INT64 i);
export void OPM_WriteLn (void);
export void OPM_WriteReal (LONGREAL r, CHAR suffx);
export void OPM_WriteString (CHAR *s, LONGINT s__len);
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
export BOOLEAN OPM_eofSF (void);
export void OPM_err (int16 n);
export void OPM_err (INT16 n);
#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s
@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len)
__DEL(s);
}
void OPM_LogWNum (int64 i, int64 len)
void OPM_LogWNum (INT64 i, INT64 len)
{
Out_Int(i, len);
}
@ -122,32 +122,32 @@ void OPM_LogWLn (void)
Out_Ln();
}
int64 OPM_SignedMaximum (int32 bytecount)
INT64 OPM_SignedMaximum (INT32 bytecount)
{
int64 result;
INT64 result;
result = 1;
result = __LSH(result, __ASHL(bytecount, 3) - 1, 64);
return result - 1;
}
int64 OPM_SignedMinimum (int32 bytecount)
INT64 OPM_SignedMinimum (INT32 bytecount)
{
return -OPM_SignedMaximum(bytecount) - 1;
}
int32 OPM_Longint (int64 n)
INT32 OPM_Longint (INT64 n)
{
return __VAL(int32, n);
return __VAL(INT32, n);
}
int16 OPM_Integer (int64 n)
INT16 OPM_Integer (INT64 n)
{
return __VAL(int16, n);
return __VAL(INT16, n);
}
static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
__DUP(s, s__len, CHAR);
i = 1;
while (s[__X(i, s__len)] != 0x00) {
@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len)
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
OPM_LogWLn();
} else {
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48;
i += 2;
}
break;
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
OPM_Alignment = (INT16)s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
@ -465,7 +465,7 @@ void OPM_InitOptions (void)
void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
{
Texts_Text T = NIL;
int32 beg, end, time;
INT32 beg, end, time;
CHAR s[256];
*done = 0;
OPM_curpos = 0;
@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch)
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len)
{
int16 i, j;
INT16 i, j;
CHAR ch;
__DUP(ext, ext__len, CHAR);
i = 0;
@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
__DEL(ext);
}
static void OPM_LogErrMsg (int16 n)
static void OPM_LogErrMsg (INT16 n)
{
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
int16 i;
INT16 i;
CHAR buf[1024];
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n)
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos)
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
{
CHAR ch, cheol;
if (pos < (int64)OPM_ErrorLineStartPos) {
if (pos < (INT64)OPM_ErrorLineStartPos) {
OPM_ErrorLineStartPos = 0;
OPM_ErrorLineLimitPos = 0;
OPM_ErrorLineNumber = 0;
}
if (pos < (int64)OPM_ErrorLineLimitPos) {
if (pos < (INT64)OPM_ErrorLineLimitPos) {
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
return;
}
Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos);
Files_Read(&*r, r__typ, (void*)&ch);
while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos;
OPM_ErrorLineNumber += 1;
while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) {
@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
}
static void OPM_ShowLine (int64 pos)
static void OPM_ShowLine (INT64 pos)
{
Files_File f = NIL;
Files_Rider r;
CHAR line[1023];
int16 i;
INT16 i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos)
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= (int64)OPM_ErrorLineLimitPos) {
if (pos >= (INT64)OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos);
i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f);
}
void OPM_Mark (int16 n, int32 pos)
void OPM_Mark (INT16 n, INT32 pos)
{
if (pos == -1) {
pos = 0;
@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos)
}
}
void OPM_err (int16 n)
void OPM_err (INT16 n)
{
OPM_Mark(n, OPM_errpos);
}
void OPM_FPrint (int32 *fp, int64 val)
void OPM_FPrint (INT32 *fp, INT64 val)
{
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
*fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32);
}
void OPM_FPrintSet (int32 *fp, uint64 set)
void OPM_FPrintSet (INT32 *fp, UINT64 set)
{
OPM_FPrint(&*fp, __VAL(int32, set));
OPM_FPrint(&*fp, __VAL(INT32, set));
}
void OPM_FPrintReal (int32 *fp, REAL real)
void OPM_FPrintReal (INT32 *fp, REAL real)
{
int16 i;
int32 l;
__GET((address)&real, l, int32);
INT16 i;
INT32 l;
__GET((address)&real, l, INT32);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (int32 *fp, LONGREAL lr)
void OPM_FPrintLReal (INT32 *fp, LONGREAL lr)
{
int32 l, h;
__GET((address)&lr, l, int32);
__GET((address)&lr + 4, h, int32);
INT32 l, h;
__GET((address)&lr, l, INT32);
__GET((address)&lr + 4, h, INT32);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}
@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch)
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch);
}
int32 OPM_SymRInt (void)
INT32 OPM_SymRInt (void)
{
int32 k;
INT32 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4);
return k;
}
int64 OPM_SymRInt64 (void)
INT64 OPM_SymRInt64 (void)
{
int64 k;
INT64 k;
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8);
return k;
}
void OPM_SymRSet (uint64 *s)
void OPM_SymRSet (UINT64 *s)
{
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8);
}
@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch)
Files_Write(&OPM_newSF, Files_Rider__typ, ch);
}
void OPM_SymWInt (int64 i)
void OPM_SymWInt (INT64 i)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
}
void OPM_SymWSet (uint64 s)
void OPM_SymWSet (UINT64 s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s);
}
void OPM_SymWReal (REAL r)
@ -841,7 +841,7 @@ void OPM_Write (CHAR ch)
void OPM_WriteString (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
{
int16 i;
INT16 i;
i = 0;
while (s[__X(i, s__len)] != 0x00) {
i += 1;
@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (int64 i)
void OPM_WriteHex (INT64 i)
{
CHAR s[3];
int32 digit;
digit = __ASHR((int32)i, 4);
INT32 digit;
digit = __ASHR((INT32)i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int32)i, -16);
digit = __MASK((INT32)i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i)
OPM_WriteString(s, 3);
}
void OPM_WriteInt (int64 i)
void OPM_WriteInt (INT64 i)
{
CHAR s[24];
int64 i1, k;
INT64 i1, k;
if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_Reader R;
CHAR s[32];
CHAR ch;
int16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
INT16 i;
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt((int32)__ENTIER(r));
OPM_WriteInt((INT32)__ENTIER(r));
} else {
Texts_OpenWriter(&W, Texts_Writer__typ);
if (suffx == 'f') {
@ -960,7 +960,7 @@ void OPM_WriteLn (void)
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F)
static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F)
{
Files_Rider R1;
CHAR buffer[4096];
@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
void OPM_CloseFiles (void)
{
CHAR FName[32];
int16 res;
INT16 res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPM__h
#define OPM__h
@ -7,14 +7,14 @@
import CHAR OPM_Model[10];
import int16 OPM_AddressSize, OPM_Alignment;
import uint32 OPM_GlobalOptions, OPM_Options;
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import int64 OPM_MaxIndex;
import INT16 OPM_AddressSize, OPM_Alignment;
import UINT32 OPM_GlobalOptions, OPM_Options;
import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize;
import INT64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr;
import int32 OPM_curpos, OPM_errpos, OPM_breakpc;
import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import INT32 OPM_curpos, OPM_errpos, OPM_breakpc;
import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
import CHAR OPM_modName[32];
import CHAR OPM_objname[64];
import CHAR OPM_ResourceDir[1024];
@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024];
import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void);
import void OPM_DeleteNewSym (void);
import void OPM_FPrint (int32 *fp, int64 val);
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
import void OPM_FPrintReal (int32 *fp, REAL real);
import void OPM_FPrintSet (int32 *fp, uint64 set);
import void OPM_FPrint (INT32 *fp, INT64 val);
import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr);
import void OPM_FPrintReal (INT32 *fp, REAL real);
import void OPM_FPrintSet (INT32 *fp, UINT64 set);
import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
import void OPM_InitOptions (void);
import int16 OPM_Integer (int64 n);
import INT16 OPM_Integer (INT64 n);
import void OPM_LogW (CHAR ch);
import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWNum (INT64 i, INT64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int32 pos);
import INT32 OPM_Longint (INT64 n);
import void OPM_Mark (INT16 n, INT32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
import BOOLEAN OPM_OpenPar (void);
import void OPM_RegisterNewSym (void);
import int64 OPM_SignedMaximum (int32 bytecount);
import int64 OPM_SignedMinimum (int32 bytecount);
import INT64 OPM_SignedMaximum (INT32 bytecount);
import INT64 OPM_SignedMinimum (INT32 bytecount);
import void OPM_SymRCh (CHAR *ch);
import int32 OPM_SymRInt (void);
import int64 OPM_SymRInt64 (void);
import INT32 OPM_SymRInt (void);
import INT64 OPM_SymRInt64 (void);
import void OPM_SymRLReal (LONGREAL *lr);
import void OPM_SymRReal (REAL *r);
import void OPM_SymRSet (uint64 *s);
import void OPM_SymRSet (UINT64 *s);
import void OPM_SymWCh (CHAR ch);
import void OPM_SymWInt (int64 i);
import void OPM_SymWInt (INT64 i);
import void OPM_SymWLReal (LONGREAL lr);
import void OPM_SymWReal (REAL r);
import void OPM_SymWSet (uint64 s);
import void OPM_SymWSet (UINT64 s);
import void OPM_Write (CHAR ch);
import void OPM_WriteHex (int64 i);
import void OPM_WriteInt (int64 i);
import void OPM_WriteHex (INT64 i);
import void OPM_WriteInt (INT64 i);
import void OPM_WriteLn (void);
import void OPM_WriteReal (LONGREAL r, CHAR suffx);
import void OPM_WriteString (CHAR *s, LONGINT s__len);
import void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
import BOOLEAN OPM_eofSF (void);
import void OPM_err (int16 n);
import void OPM_err (INT16 n);
import void *OPM__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPB.h"
@ -12,38 +12,38 @@
#include "OPT.h"
struct OPP__1 {
int32 low, high;
INT32 low, high;
};
typedef
struct OPP__1 OPP_CaseTable[128];
static int8 OPP_sym, OPP_level;
static int16 OPP_LoopLevel;
static INT8 OPP_sym, OPP_level;
static INT16 OPP_LoopLevel;
static OPT_Node OPP_TDinit, OPP_lastTDinit;
static int16 OPP_nofFwdPtr;
static INT16 OPP_nofFwdPtr;
static OPT_Struct OPP_FwdPtr[64];
export address *OPP__1__typ;
export ADDRESS *OPP__1__typ;
static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar);
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (int8 *vis);
static void OPP_CheckSym (int16 s);
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_);
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab);
static void OPP_CheckMark (INT8 *vis);
static void OPP_CheckSym (INT16 s);
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_);
static void OPP_ConstExpression (OPT_Node *x);
static void OPP_Element (OPT_Node *x);
static void OPP_Expression (OPT_Node *x);
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
static void OPP_Factor (OPT_Node *x);
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
export void OPP_Module (OPT_Node *prog, uint32 opt);
export void OPP_Module (OPT_Node *prog, UINT32 opt);
static void OPP_PointerType (OPT_Struct *typ);
static void OPP_ProcedureDeclaration (OPT_Node *x);
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_Sets (OPT_Node *x);
static void OPP_SimpleExpression (OPT_Node *x);
@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat);
static void OPP_Term (OPT_Node *x);
static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned);
static void OPP_err (int16 n);
static void OPP_err (INT16 n);
static void OPP_qualident (OPT_Object *id);
static void OPP_selector (OPT_Node *x);
static void OPP_err (int16 n)
static void OPP_err (INT16 n)
{
OPM_err(n);
}
static void OPP_CheckSym (int16 s)
static void OPP_CheckSym (INT16 s)
{
if ((int16)OPP_sym == s) {
if ((INT16)OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s)
static void OPP_qualident (OPT_Object *id)
{
OPT_Object obj = NIL;
int8 lev;
INT8 lev;
OPT_Find(&obj);
OPS_Get(&OPP_sym);
if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) {
@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x)
}
}
static void OPP_CheckMark (int8 *vis)
static void OPP_CheckMark (INT8 *vis)
{
OPS_Get(&OPP_sym);
if (OPP_sym == 1 || OPP_sym == 7) {
@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis)
}
}
static void OPP_CheckSysFlag (int16 *sysflag, int16 default_)
static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_)
{
OPT_Node x = NIL;
int64 sf;
INT64 sf;
if (OPP_sym == 31) {
OPS_Get(&OPP_sym);
if (!OPT_SYSimported) {
@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL;
OPT_Struct ftyp = NIL;
int16 sysflag;
INT16 sysflag;
*typ = OPT_NewStr(13, 4);
(*typ)->BaseTyp = NIL;
OPP_CheckSysFlag(&sysflag, -1);
@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned)
static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
{
OPT_Node x = NIL;
int64 n;
int16 sysflag;
INT64 n;
INT16 sysflag;
OPP_CheckSysFlag(&sysflag, 0);
if (OPP_sym == 25) {
*typ = OPT_NewStr(13, 3);
@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ)
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp)
{
int8 mode;
INT8 mode;
OPT_Object par = NIL, first = NIL, last = NIL, res = NIL;
OPT_Struct typ = NIL;
first = NIL;
@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar)
static void OPP_StandProcCall (OPT_Node *x)
{
OPT_Node y = NIL;
int8 m;
int16 n;
m = (int8)((int16)(*x)->obj->adr);
INT8 m;
INT16 n;
m = (INT8)((INT16)(*x)->obj->adr);
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x)
static void OPP_Term (OPT_Node *x)
{
OPT_Node y = NIL;
int8 mulop;
INT8 mulop;
OPP_Factor(&*x);
while ((1 <= OPP_sym && OPP_sym <= 5)) {
mulop = OPP_sym;
@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x)
static void OPP_SimpleExpression (OPT_Node *x)
{
OPT_Node y = NIL;
int8 addop;
INT8 addop;
if (OPP_sym == 7) {
OPS_Get(&OPP_sym);
OPP_Term(&*x);
@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x)
{
OPT_Node y = NIL;
OPT_Object obj = NIL;
int8 relation;
INT8 relation;
OPP_SimpleExpression(&*x);
if ((9 <= OPP_sym && OPP_sym <= 14)) {
relation = OPP_sym;
@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x)
}
}
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec)
{
OPT_Object obj = NIL;
*typ = OPT_undftyp;
@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 {
OPT_Node *x;
OPT_Object *proc, *fwd;
OPS_Name *name;
int8 *mode, *vis;
INT8 *mode, *vis;
BOOLEAN *forward;
struct ProcedureDeclaration__16 *lnk;
} *ProcedureDeclaration__16_s;
@ -930,8 +930,8 @@ static void TProcDecl__23 (void);
static void GetCode__19 (void)
{
OPT_ConstExt ext = NIL;
int16 n;
int64 c;
INT16 n;
INT64 c;
ext = OPT_NewExt();
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
@ -995,7 +995,7 @@ static void GetParams__21 (void)
static void Body__17 (void)
{
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
c = OPM_errpos;
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64);
OPP_CheckSym(39);
@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void)
{
OPT_Object baseProc = NIL;
OPT_Struct objTyp = NIL, recTyp = NIL;
int8 objMode;
INT8 objMode;
OPS_Name objName;
OPS_Get(&OPP_sym);
*ProcedureDeclaration__16_s->mode = 13;
@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
{
OPT_Object proc = NIL, fwd = NIL;
OPS_Name name;
int8 mode, vis;
INT8 mode, vis;
BOOLEAN forward;
struct ProcedureDeclaration__16 _s;
_s.x = x;
@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
ProcedureDeclaration__16_s = _s.lnk;
}
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab)
static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab)
{
OPT_Node x = NIL, y = NIL, lastlab = NIL;
int16 i, f;
int32 xval, yval;
INT16 i, f;
INT32 xval, yval;
*lab = NIL;
lastlab = NIL;
for (;;) {
@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int16)LabelTyp->form != f) {
} else if ((INT16)LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = OPM_Longint(y->conval->intval);
if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) {
OPP_err(60);
}
if (yval < xval) {
@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP
}
static struct StatSeq__30 {
int32 *pos;
INT32 *pos;
struct StatSeq__30 *lnk;
} *StatSeq__30_s;
@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x);
static void CasePart__31 (OPT_Node *x)
{
int16 n;
int32 low, high;
INT16 n;
INT32 low, high;
BOOLEAN e;
OPP_CaseTable tab;
OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL;
@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPT_Struct idtyp = NIL;
BOOLEAN e;
OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL;
int32 pos;
INT32 pos;
OPS_Name name;
struct StatSeq__30 _s;
_s.pos = &pos;
@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPT_Struct typ = NIL;
OPT_Object obj = NIL, first = NIL, last = NIL;
OPT_Node x = NIL, lastdec = NIL;
int16 i;
INT16 i;
first = NIL;
last = NIL;
OPP_nofFwdPtr = 0;
@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_CheckSym(41);
}
void OPP_Module (OPT_Node *prog, uint32 opt)
void OPP_Module (OPT_Node *prog, UINT32 opt)
{
OPS_Name impName, aliasName;
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
INT32 c;
BOOLEAN done;
OPS_Init();
OPP_LoopLevel = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPP__h
#define OPP__h
@ -9,7 +9,7 @@
import void OPP_Module (OPT_Node *prog, uint32 opt);
import void OPP_Module (OPT_Node *prog, UINT32 opt);
import void *OPP__init(void);

View file

@ -1,9 +1,9 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT int8
#define INTEGER int16
#define LONGINT int32
#define SET uint32
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
#include "OPM.h"
@ -17,29 +17,29 @@ typedef
export OPS_Name OPS_name;
export OPS_String OPS_str;
export int16 OPS_numtyp;
export int64 OPS_intval;
export INT16 OPS_numtyp;
export INT64 OPS_intval;
export REAL OPS_realval;
export LONGREAL OPS_lrlval;
static CHAR OPS_ch;
export void OPS_Get (int8 *sym);
static void OPS_Identifier (int8 *sym);
export void OPS_Get (INT8 *sym);
static void OPS_Identifier (INT8 *sym);
export void OPS_Init (void);
static void OPS_Number (void);
static void OPS_Str (int8 *sym);
static void OPS_err (int16 n);
static void OPS_Str (INT8 *sym);
static void OPS_err (INT16 n);
static void OPS_err (int16 n)
static void OPS_err (INT16 n)
{
OPM_err(n);
}
static void OPS_Str (int8 *sym)
static void OPS_Str (INT8 *sym)
{
int16 i;
INT16 i;
CHAR och;
i = 0;
och = OPS_ch;
@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int16)OPS_str[0];
OPS_intval = (INT16)OPS_str[0];
} else {
*sym = 37;
}
}
static void OPS_Identifier (int8 *sym)
static void OPS_Identifier (INT8 *sym)
{
int16 i;
INT16 i;
i = 0;
do {
OPS_name[i] = OPS_ch;
@ -92,10 +92,10 @@ static struct Number__6 {
struct Number__6 *lnk;
} *Number__6_s;
static int16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (int16 e);
static INT16 Ord__7 (CHAR ch, BOOLEAN hex);
static LONGREAL Ten__9 (INT16 e);
static LONGREAL Ten__9 (int16 e)
static LONGREAL Ten__9 (INT16 e)
{
LONGREAL x, p;
x = (LONGREAL)1;
@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e)
return x;
}
static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static INT16 Ord__7 (CHAR ch, BOOLEAN hex)
{
if (ch <= '9') {
return (int16)ch - 48;
return (INT16)ch - 48;
} else if (hex) {
return ((int16)ch - 65) + 10;
return ((INT16)ch - 65) + 10;
} else {
OPS_err(2);
return 0;
@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex)
static void OPS_Number (void)
{
int16 i, m, n, d, e;
INT16 i, m, n, d, e;
CHAR dig[24];
LONGREAL f;
CHAR expCh;
@ -173,7 +173,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -187,7 +187,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -198,8 +198,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) {
OPS_intval = OPS_intval * 10 + (int64)d;
if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) {
OPS_intval = OPS_intval * 10 + (INT64)d;
} else {
OPS_err(203);
}
@ -308,9 +308,9 @@ static void Comment__2 (void)
}
}
void OPS_Get (int8 *sym)
void OPS_Get (INT8 *sym)
{
int8 s;
INT8 s;
struct Get__1 _s;
_s.lnk = Get__1_s;
Get__1_s = &_s;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef OPS__h
#define OPS__h
@ -14,13 +14,13 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import INT16 OPS_numtyp;
import INT64 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;
import void OPS_Get (int8 *sym);
import void OPS_Get (INT8 *sym);
import void OPS_Init (void);
import void *OPS__init(void);

Some files were not shown because too many files have changed in this diff Show more