From be685810198bc55596683283d8fc3b65edea355f Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 7 Jan 1987 11:10:33 +0000 Subject: [PATCH] *** empty log message *** --- util/cpp/Makefile | 11 ++++------- util/cpp/Parameters | 6 +++--- util/cpp/preprocess.c | 31 +++++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/util/cpp/Makefile b/util/cpp/Makefile index d02b11553..4df03654d 100644 --- a/util/cpp/Makefile +++ b/util/cpp/Makefile @@ -72,10 +72,13 @@ all: cc cc: hfiles LLfiles make "EMHOME="$(EMHOME) cpp -hfiles: Parameters +hfiles: Parameters char.c charoffset.h ./make.hfiles Parameters @touch hfiles +charoffset.h char.c: chtab char.tab + chtab -fchar.tab > char.c + LLfiles: $(LSRC) $(GEN) $(GENOPTIONS) $(LSRC) @touch LLfiles @@ -86,12 +89,6 @@ tokenfile.g: tokenname.c make.tokfile symbol2str.c: tokenname.c make.tokcase symbol2str.c -char.c: char.tab chtab - chtab -fchar.tab > char.c - -charoffset.h: chtab char.tab - chtab -fchar.tab > /dev/null - chtab: chtab.o $(CC) -o chtab chtab.o diff --git a/util/cpp/Parameters b/util/cpp/Parameters index 21bd8a667..74694b521 100644 --- a/util/cpp/Parameters +++ b/util/cpp/Parameters @@ -35,7 +35,7 @@ !File: strsize.h #define ISTRSIZE 32 /* minimum number of bytes allocated for storing a string */ -#define RSTRSIZE 8 /* step size in enlarging the memory for +#define RSTRSIZE 32 /* step size in enlarging the memory for the storage of a string */ @@ -52,8 +52,8 @@ !File: textsize.h -#define ITEXTSIZE 32 /* 1st piece of memory for repl. text */ -#define RTEXTSIZE 32 /* stepsize for enlarging repl.text */ +#define ITEXTSIZE 64 /* 1st piece of memory for repl. text */ +#define RTEXTSIZE 64 /* stepsize for enlarging repl.text */ !File: inputtype.h diff --git a/util/cpp/preprocess.c b/util/cpp/preprocess.c index 935d178c7..bd05c5681 100644 --- a/util/cpp/preprocess.c +++ b/util/cpp/preprocess.c @@ -16,6 +16,11 @@ char _obuf[OBUFSIZE]; char bits[128]; #endif +Xflush() +{ + sys_write(STDOUT, _obuf, OBUFSIZE); +} + preprocess(fn) char *fn; { @@ -25,8 +30,8 @@ preprocess(fn) int lineno = 0; extern char options[]; -#define flush(X) (sys_write(STDOUT,_obuf,X), op = _obuf) -#define echo(ch) (op != ob || flush(OBUFSIZE), *op++ = (ch)) +#define flush(X) (sys_write(STDOUT,_obuf,X)) +#define echo(ch) if (op == ob) { Xflush(); op = _obuf; } *op++ = (ch); #define newline() echo('\n') for (;;) { @@ -48,7 +53,9 @@ preprocess(fn) lineno = LineNumber; sprint(p, "#line %d \"%s\"\n", LineNumber, FileName); - while (*p) echo(*p++); + while (*p) { + echo(*p++); + } } for (;;) { if (c & 0200) { @@ -78,17 +85,23 @@ preprocess(fn) return; } else if (c == '*') { - if (options['C']) echo(c); + if (options['C']) { + echo(c); + } LoadChar(c); if (c == '/') { - if (options['C']) echo(c); - break; + if (options['C']) { + echo(c); + } + break; } else { PushBack(); } } - else if (options['C']) echo(c); + else if (options['C']) { + echo(c); + } } NoUnstack--; LoadChar(c); @@ -189,7 +202,9 @@ preprocess(fn) nomac: *tg = 0; tg = buf; - while (*tg) echo(*tg++); + while (*tg) { + echo(*tg++); + } LoadChar(c); while (in_idf(c)) { echo(c);