Skip to content

Commit 3cb60cc

Browse files
committed
Update C bootstrap source.
1 parent 412a8c3 commit 3cb60cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+870
-3740
lines changed

bootstrap/unix-44/Compiler.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16
@@ -122,7 +122,7 @@ static void Compiler_FindLocalObjectFiles (CHAR *objectnames, ADDRESS objectname
122122
Strings_Append((CHAR*)" ", 2, (void*)objectnames, objectnames__len);
123123
Strings_Append(fn, 64, (void*)objectnames, objectnames__len);
124124
} else {
125-
OPM_LogVT100((CHAR*)"33m", 4);
125+
OPM_LogVT100((CHAR*)"91m", 4);
126126
OPM_LogWStr((CHAR*)"Link warning: a local symbol file is present for module ", 57);
127127
OPM_LogWStr(l->name, 256);
128128
OPM_LogWStr((CHAR*)", but local object file '", 26);

bootstrap/unix-44/Configuration.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16
@@ -19,6 +19,6 @@ export void *Configuration__init(void)
1919
__DEFMOD;
2020
__REGMOD("Configuration", 0);
2121
/* BEGIN */
22-
__MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
22+
__MOVE("2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
2323
__ENDMOD;
2424
}

bootstrap/unix-44/Configuration.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#ifndef Configuration__h
44
#define Configuration__h

bootstrap/unix-44/Files.c

+1-131
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16
@@ -69,9 +69,6 @@ static void Files_CloseOSFile (Files_File f);
6969
static void Files_Create (Files_File f);
7070
export void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res);
7171
static void Files_Deregister (CHAR *name, ADDRESS name__len);
72-
export void Files_DumpBuffer (Files_Buffer b, INT16 indent);
73-
export void Files_DumpFile (Files_File f, INT16 indent);
74-
export void Files_DumpRider (Files_Rider r, INT16 indent);
7572
static void Files_Err (CHAR *s, ADDRESS s__len, Files_File f, INT16 errcode);
7673
static void Files_Finalize (SYSTEM_PTR o);
7774
static void Files_FlipBytes (SYSTEM_BYTE *src, ADDRESS src__len, SYSTEM_BYTE *dest, ADDRESS dest__len);
@@ -102,7 +99,6 @@ export void Files_Rename (CHAR *old, ADDRESS old__len, CHAR *new, ADDRESS new__l
10299
static void Files_ScanPath (INT16 *pos, CHAR *dir, ADDRESS dir__len);
103100
export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos);
104101
export void Files_SetSearchPath (CHAR *path, ADDRESS path__len);
105-
static void Files_Spaces (INT16 i);
106102
export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x);
107103
export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x);
108104
export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, ADDRESS x__len, INT32 n);
@@ -116,132 +112,6 @@ export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, ADDRESS
116112

117113
#define Files_IdxTrap() __HALT(-1)
118114

119-
static void Files_Spaces (INT16 i)
120-
{
121-
while (i > 0) {
122-
Out_String((CHAR*)" ", 3);
123-
i -= 1;
124-
}
125-
}
126-
127-
void Files_DumpFile (Files_File f, INT16 indent)
128-
{
129-
Files_Spaces(indent);
130-
Out_String((CHAR*)"workName: ", 15);
131-
Out_String(f->workName, 101);
132-
Out_Ln();
133-
Files_Spaces(indent);
134-
Out_String((CHAR*)"registerName: ", 15);
135-
Out_String(f->registerName, 101);
136-
Out_Ln();
137-
Files_Spaces(indent);
138-
Out_String((CHAR*)"tempFile: ", 15);
139-
if (f->tempFile) {
140-
Out_String((CHAR*)"TRUE", 5);
141-
} else {
142-
Out_String((CHAR*)"FALSE", 6);
143-
}
144-
Out_Ln();
145-
Files_Spaces(indent);
146-
Out_String((CHAR*)"identity: ", 15);
147-
Out_String((CHAR*)"...", 4);
148-
Out_Ln();
149-
Files_Spaces(indent);
150-
Out_String((CHAR*)"fd: ", 15);
151-
Out_Int(f->fd, 1);
152-
Out_Ln();
153-
Files_Spaces(indent);
154-
Out_String((CHAR*)"len, ", 15);
155-
Out_Int(f->len, 1);
156-
Out_Ln();
157-
Files_Spaces(indent);
158-
Out_String((CHAR*)"pos: ", 15);
159-
Out_Int(f->pos, 1);
160-
Out_Ln();
161-
Files_Spaces(indent);
162-
Out_String((CHAR*)"bufs: ", 15);
163-
Out_String((CHAR*)"...", 4);
164-
Out_Ln();
165-
Files_Spaces(indent);
166-
Out_String((CHAR*)"swapper: ", 15);
167-
Out_Int(f->swapper, 1);
168-
Out_Ln();
169-
Files_Spaces(indent);
170-
Out_String((CHAR*)"state: ", 15);
171-
Out_Int(f->state, 1);
172-
Out_Ln();
173-
Files_Spaces(indent);
174-
Out_String((CHAR*)"next: ", 15);
175-
Out_Hex((INT32)(ADDRESS)f->next, 1);
176-
Out_Ln();
177-
}
178-
179-
void Files_DumpBuffer (Files_Buffer b, INT16 indent)
180-
{
181-
Files_Spaces(indent);
182-
Out_String((CHAR*)"chg: ", 7);
183-
if (b->chg) {
184-
Out_String((CHAR*)"TRUE", 5);
185-
} else {
186-
Out_String((CHAR*)"FALSE", 6);
187-
}
188-
Out_Ln();
189-
Files_Spaces(indent);
190-
Out_String((CHAR*)"org: ", 7);
191-
Out_Int(b->org, 1);
192-
Out_Ln();
193-
Files_Spaces(indent);
194-
Out_String((CHAR*)"size: ", 7);
195-
Out_Int(b->size, 1);
196-
Out_Ln();
197-
Files_Spaces(indent);
198-
Out_String((CHAR*)"data: ", 7);
199-
Out_Ln();
200-
Out_HexDump((void*)b->data, 4096);
201-
Files_Spaces(indent);
202-
Out_String((CHAR*)"f: ", 7);
203-
if (b->f == NIL) {
204-
Out_String((CHAR*)"<NIL>", 6);
205-
Out_Ln();
206-
} else {
207-
Out_Ln();
208-
Files_DumpFile(b->f, indent + 1);
209-
}
210-
}
211-
212-
void Files_DumpRider (Files_Rider r, INT16 indent)
213-
{
214-
Files_Spaces(indent);
215-
Out_String((CHAR*)"res: ", 9);
216-
Out_Int(r.res, 1);
217-
Out_Ln();
218-
Files_Spaces(indent);
219-
Out_String((CHAR*)"eof: ", 9);
220-
if (r.eof) {
221-
Out_String((CHAR*)"TRUE", 5);
222-
} else {
223-
Out_String((CHAR*)"FALSE", 6);
224-
}
225-
Out_Ln();
226-
Files_Spaces(indent);
227-
Out_String((CHAR*)"org: ", 9);
228-
Out_Int(r.org, 1);
229-
Out_Ln();
230-
Files_Spaces(indent);
231-
Out_String((CHAR*)"offset: ", 9);
232-
Out_Int(r.offset, 1);
233-
Out_Ln();
234-
Files_Spaces(indent);
235-
Out_String((CHAR*)"buf: ", 9);
236-
if (r.buf == NIL) {
237-
Out_String((CHAR*)"<NIL>", 6);
238-
Out_Ln();
239-
} else {
240-
Out_Ln();
241-
Files_DumpBuffer(r.buf, indent + 1);
242-
}
243-
}
244-
245115
static void Files_Assert (BOOLEAN truth)
246116
{
247117
if (!truth) {

bootstrap/unix-44/Files.h

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
22

33
#ifndef Files__h
44
#define Files__h
55

66
#include "SYSTEM.h"
77

8-
typedef
9-
struct Files_BufDesc {
10-
INT32 _prvt0;
11-
char _prvt1[4108];
12-
} Files_BufDesc;
13-
14-
typedef
15-
Files_BufDesc *Files_Buffer;
16-
178
typedef
189
struct Files_FileDesc *Files_File;
1910

@@ -33,16 +24,12 @@ typedef
3324

3425

3526
import ADDRESS *Files_FileDesc__typ;
36-
import ADDRESS *Files_BufDesc__typ;
3727
import ADDRESS *Files_Rider__typ;
3828

3929
import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ);
4030
import void Files_ChangeDirectory (CHAR *path, ADDRESS path__len, INT16 *res);
4131
import void Files_Close (Files_File f);
4232
import void Files_Delete (CHAR *name, ADDRESS name__len, INT16 *res);
43-
import void Files_DumpBuffer (Files_Buffer b, INT16 indent);
44-
import void Files_DumpFile (Files_File f, INT16 indent);
45-
import void Files_DumpRider (Files_Rider r, INT16 indent);
4633
import void Files_GetDate (Files_File f, INT32 *t, INT32 *d);
4734
import void Files_GetName (Files_File f, CHAR *name, ADDRESS name__len);
4835
import INT32 Files_Length (Files_File f);

bootstrap/unix-44/Heap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16

bootstrap/unix-44/Heap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
22

33
#ifndef Heap__h
44
#define Heap__h

bootstrap/unix-44/Modules.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16

bootstrap/unix-44/Modules.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#ifndef Modules__h
44
#define Modules__h

bootstrap/unix-44/OPB.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16

bootstrap/unix-44/OPB.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#ifndef OPB__h
44
#define OPB__h

bootstrap/unix-44/OPC.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16

bootstrap/unix-44/OPC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#ifndef OPC__h
44
#define OPC__h

bootstrap/unix-44/OPM.c

+23-42
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
1+
/* voc 2.00 [2016/12/20]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
22

33
#define SHORTINT INT8
44
#define INTEGER INT16
@@ -63,6 +63,7 @@ export void OPM_Init (BOOLEAN *done);
6363
export void OPM_InitOptions (void);
6464
export INT16 OPM_Integer (INT64 n);
6565
static BOOLEAN OPM_IsProbablyInstallDir (CHAR *s, ADDRESS s__len);
66+
export void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len);
6667
static void OPM_LogErrMsg (INT16 n);
6768
export void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len);
6869
export void OPM_LogW (CHAR ch);
@@ -92,7 +93,6 @@ export void OPM_SymWInt (INT64 i);
9293
export void OPM_SymWLReal (LONGREAL lr);
9394
export void OPM_SymWReal (REAL r);
9495
export void OPM_SymWSet (UINT64 s);
95-
static void OPM_VerboseListSizes (void);
9696
export void OPM_Write (CHAR ch);
9797
export void OPM_WriteHex (INT64 i);
9898
export void OPM_WriteInt (INT64 i);
@@ -136,6 +136,27 @@ void OPM_LogVT100 (CHAR *vt100code, ADDRESS vt100code__len)
136136
__DEL(vt100code);
137137
}
138138

139+
void OPM_LogCompiling (CHAR *modname, ADDRESS modname__len)
140+
{
141+
__DUP(modname, modname__len, CHAR);
142+
OPM_LogWStr((CHAR*)"Compiling ", 11);
143+
OPM_LogWStr(modname, modname__len);
144+
if (__IN(18, OPM_Options, 32)) {
145+
OPM_LogWStr((CHAR*)", s:", 5);
146+
OPM_LogWNum(__ASHL(OPM_ShortintSize, 3), 1);
147+
OPM_LogWStr((CHAR*)" i:", 4);
148+
OPM_LogWNum(__ASHL(OPM_IntegerSize, 3), 1);
149+
OPM_LogWStr((CHAR*)" l:", 4);
150+
OPM_LogWNum(__ASHL(OPM_LongintSize, 3), 1);
151+
OPM_LogWStr((CHAR*)" adr:", 6);
152+
OPM_LogWNum(__ASHL(OPM_AddressSize, 3), 1);
153+
OPM_LogWStr((CHAR*)" algn:", 7);
154+
OPM_LogWNum(__ASHL(OPM_Alignment, 3), 1);
155+
}
156+
OPM_LogW('.');
157+
__DEL(modname);
158+
}
159+
139160
INT64 OPM_SignedMaximum (INT32 bytecount)
140161
{
141162
INT64 result;
@@ -363,32 +384,6 @@ BOOLEAN OPM_OpenPar (void)
363384
__RETCHK;
364385
}
365386

366-
static void OPM_VerboseListSizes (void)
367-
{
368-
OPM_LogWLn();
369-
OPM_LogWStr((CHAR*)"Type Size", 15);
370-
OPM_LogWLn();
371-
OPM_LogWStr((CHAR*)"SHORTINT ", 12);
372-
OPM_LogWNum(OPM_ShortintSize, 4);
373-
OPM_LogWLn();
374-
OPM_LogWStr((CHAR*)"INTEGER ", 12);
375-
OPM_LogWNum(OPM_IntegerSize, 4);
376-
OPM_LogWLn();
377-
OPM_LogWStr((CHAR*)"LONGINT ", 12);
378-
OPM_LogWNum(OPM_LongintSize, 4);
379-
OPM_LogWLn();
380-
OPM_LogWStr((CHAR*)"SET ", 12);
381-
OPM_LogWNum(OPM_LongintSize, 4);
382-
OPM_LogWLn();
383-
OPM_LogWStr((CHAR*)"ADDRESS ", 12);
384-
OPM_LogWNum(OPM_AddressSize, 4);
385-
OPM_LogWLn();
386-
OPM_LogWLn();
387-
OPM_LogWStr((CHAR*)"Alignment: ", 12);
388-
OPM_LogWNum(OPM_Alignment, 4);
389-
OPM_LogWLn();
390-
}
391-
392387
void OPM_InitOptions (void)
393388
{
394389
CHAR s[256];
@@ -432,9 +427,6 @@ void OPM_InitOptions (void)
432427
OPM_LongintSize = 4;
433428
break;
434429
}
435-
if (__IN(18, OPM_Options, 32)) {
436-
OPM_VerboseListSizes();
437-
}
438430
__MOVE(OPM_InstallDir, OPM_ResourceDir, 1024);
439431
if (OPM_ResourceDir[0] != 0x00) {
440432
Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024);
@@ -491,17 +483,6 @@ void OPM_Get (CHAR *ch)
491483
{
492484
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
493485
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
494-
if ((OPM_curpos == 0 && OPM_inR.eot)) {
495-
OPM_LogWLn();
496-
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
497-
OPM_LogWNum((INT16)*ch, 1);
498-
OPM_LogW('.');
499-
Texts_DumpReader(OPM_inR);
500-
OPM_LogWLn();
501-
OPM_LogWStr((CHAR*)"Heap dump:", 11);
502-
OPM_LogWLn();
503-
Out_DumpHeap();
504-
}
505486
if ((*ch < 0x09 && !OPM_inR.eot)) {
506487
*ch = ' ';
507488
}

0 commit comments

Comments
 (0)