diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-03-02 09:49:21 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-03-11 23:41:05 +0100 |
commit | 95ceadd4174967187190ae1801aec3deb73536a5 (patch) | |
tree | e1f56e4494953e349a25485d31b4ac9982f6df31 /rsc | |
parent | 7b02141c218db334b75c0d8e524ac8a20e5fe693 (diff) |
Some cleaning
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/rscpp/cpp1.c | 28 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp2.c | 10 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp3.c | 25 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp4.c | 12 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp5.c | 13 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp6.c | 20 | ||||
-rw-r--r-- | rsc/source/rscpp/cppdef.h | 9 |
7 files changed, 38 insertions, 79 deletions
diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c index d02467a939b9..378adaa17c5e 100644 --- a/rsc/source/rscpp/cpp1.c +++ b/rsc/source/rscpp/cpp1.c @@ -39,7 +39,7 @@ FILE *pDefOut = NULL; /* ER evtl. #define's dump */ #endif #ifdef B200 -/* BP, 25.07.91, einzige Moeglichkeit unter BC Stack und Heap festzusetzen */ +/* einzige Moeglichkeit unter BC Stack und Heap festzusetzen */ extern unsigned _stklen = 24000; extern unsigned _heaplen = 30000; #endif @@ -189,7 +189,7 @@ char *magic[] = { /* Note: order is important */ "__FILE__", NULL /* Must be last */ }; - + static char *sharpfilename = NULL; int nRunde = 0; @@ -197,7 +197,6 @@ int nRunde = 0; void InitCpp1() { int i; - /* BP */ /* in der LIB-Version muessen alle Variablen initialisiert werden */ line = wrongline = errors = recursion = 0; @@ -234,7 +233,6 @@ void InitCpp1() nflag = 0; incend = incdir; sharpfilename = NULL; - /* BP */ } int MAIN(int argc, char** argv) @@ -287,8 +285,6 @@ nRunde++; if ((i = creat(useargv[3], 0, "rat=cr", "rfm=var")) == -1 || dup2(i, fileno(stdout)) == -1) { #else -/* alt if (freopen(useargv[3], "w", stdout) == NULL) { */ - pDefOut = fopen( useargv[3], "w" ); if( pDefOut == NULL ) { #endif @@ -298,7 +294,6 @@ nRunde++; } } /* Continue by opening output */ } -/* OSL_DEBUG_LEVEL > 1 */ #endif case 3: /* @@ -312,8 +307,6 @@ nRunde++; if ((i = creat(useargv[2], 0, "rat=cr", "rfm=var")) == -1 || dup2(i, fileno(stdout)) == -1) { #else -/* alt if (freopen(useargv[2], "w", stdout) == NULL) { */ - pCppOut = fopen( useargv[2], "w" ); if( pCppOut == NULL ) { #endif @@ -327,7 +320,6 @@ nRunde++; * Open input file, "-" means use stdin. */ if (!streq(useargv[1], "-")) { -/* alt: if (freopen(useargv[1], "r", stdin) == NULL) { */ pCppIn = fopen( useargv[1], "r" ); if( pCppIn == NULL) { perror(useargv[1]); @@ -349,16 +341,6 @@ nRunde++; default: exit(IO_ERROR); /* Can't happen */ } -/* if ( pfargv ) - { - for ( j=0;j++;j < PARALIMIT ) - { - if (pfargv[j]!=0) - free(pfargv[j]); - } - free(pfargv); - } -*/ setincdirs(); /* Setup -I include directories */ addfile( pCppIn, work); /* "open" main input file */ @@ -399,7 +381,7 @@ nRunde++; #endif } - + FILE_LOCAL void cppmain() /* @@ -551,7 +533,7 @@ end_line: if (c == '\n') { /* Compiling at EOL? */ EvalBuf[nEvalOff++] = '\0'; #endif } - + void output(int c) /* * Output one character to stdout -- output() is passed as an @@ -563,7 +545,6 @@ void output(int c) #else if (c != TOK_SEP) #endif -/* alt: PUTCHAR(c); */ PUTCHAR(c); } @@ -580,7 +561,6 @@ int c; #else if (c != TOK_SEP) #endif -/* alt: PUTCHAR(c); */ { PUTCHAR(c); if ( bIsInEval && nEvalOff < NEVALBUF ) diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c index ccc49a37ba8f..c9046c73724c 100644 --- a/rsc/source/rscpp/cpp2.c +++ b/rsc/source/rscpp/cpp2.c @@ -317,7 +317,7 @@ nest_err: cerror("#%s must be in an #if", token); } return (counter + 1); } - + FILE_LOCAL void doif(int hash) /* @@ -362,7 +362,7 @@ badif: cerror("#if, #ifdef, or #ifndef without an argument", NULLST); #endif return; } - + FILE_LOCAL void doinclude() /* @@ -432,7 +432,7 @@ void doinclude() incerr: cerror("#include syntax error", NULLST); return; } - + FILE_LOCAL int openinclude(char* filename, int searchlocal) /* @@ -508,7 +508,7 @@ openinclude(char* filename, int searchlocal) } return (FALSE); } - + FILE_LOCAL int hasdirectory(char* source, char* result) /* @@ -552,7 +552,7 @@ hasdirectory(char* source, char* result) #endif #endif } - + #if HOST == SYS_VMS /* diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c index e2e7cdd98535..3654330a9035 100644 --- a/rsc/source/rscpp/cpp3.c +++ b/rsc/source/rscpp/cpp3.c @@ -86,16 +86,14 @@ void addfile(FILE* fp, char* filename) */ { register FILEINFO *file; -/* #ifndef _NO_PROTO */ - extern FILEINFO *getfile( int bufsize, char *filename ); /* BP */ -/* #endif */ + extern FILEINFO *getfile( int bufsize, char *filename ); file = getfile(NBUFF, filename); file->fp = fp; /* Better remember FILE * */ file->buffer[0] = EOS; /* Initialize for first read */ line = 1; /* Working on line 1 now */ wrongline = TRUE; /* Force out initial #line */ } - + void setincdirs() /* * Append system-specific directories to the include directory list. @@ -159,7 +157,7 @@ void setincdirs() #if HOST == SYS_UNKNOWN /* - * BP: 25.07.91, Kontext: GenMake + * Kontext: GenMake * Unter DOS wird nun auch die Environment-Variable INCLUDE ausgewetet. * Es kommt erschwerend hinzu, dass alle Eintraege, die mit ';' getrennt * sind, mit in die Liste aufenommen werden muessen. @@ -184,7 +182,7 @@ void setincdirs() } -/* BP: 11.09.91, Kontext: Erweiterung des INCLUDE-Services +/* Kontext: Erweiterung des INCLUDE-Services * Bislang konnte der cpp keine Include-Angaben in der Kommandozeile * vertragen, bei denen die directries mit ';' getrennt wurden. * Dies ist auch verstaendlich, da dieses cpp fuer UNIX-Systeme @@ -210,9 +208,6 @@ int AddInclude( char* pIncStr ) return( 1 ); } - - - int dooptions(int argc, char** argv) /* @@ -248,9 +243,6 @@ dooptions(int argc, char** argv) break; case 'D': /* Define symbol */ -#if HOST != SYS_UNIX -/* zap_uc(ap); */ /* Force define to U.C. */ -#endif /* * If the option is just "-Dfoo", make it -Dfoo=1 */ @@ -311,9 +303,6 @@ dooptions(int argc, char** argv) break; case 'U': /* Undefine symbol */ -#if HOST != SYS_UNIX -/* zap_uc(ap);*/ -#endif if (defendel(ap, TRUE) == NULL) cwarn("\"%s\" wasn't defined", ap); break; @@ -363,7 +352,7 @@ dooptions(int argc, char** argv) } return (j); /* Return new argc */ } - + int readoptions(char* filename, char*** pfargv) { @@ -426,8 +415,6 @@ readoptions(char* filename, char*** pfargv) return (back); } - - #if HOST != SYS_UNIX FILE_LOCAL void zap_uc(char* ap) @@ -508,7 +495,7 @@ void initdefines() #endif } } - + #if HOST == SYS_VMS /* * getredirection() is intended to aid in porting C programs diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c index f64d69e2e76a..fe7de9156cb6 100644 --- a/rsc/source/rscpp/cpp4.c +++ b/rsc/source/rscpp/cpp4.c @@ -237,7 +237,7 @@ bad_define: cerror("#define syntax error", NULLST); inmacro = FALSE; /* Stop <newline> hack */ } - + void checkparm(int c, DEFBUF* dp) /* * Replace this param if it's defined. Note that the macro name is a @@ -265,7 +265,7 @@ void checkparm(int c, DEFBUF* dp) for (cp = token; *cp != EOS;) /* And save */ save(*cp++); /* The token itself */ } - + #if STRING_FORMAL void stparmscan(delim, dp) int delim; @@ -337,7 +337,7 @@ void stparmscan(int delim) workp[-1] = wp[-1]; /* Nope, reset end quote. */ } #endif - + void doundef() /* * Remove the symbol from the defined list. @@ -385,7 +385,7 @@ void charput(int c) *parmp++ = (char)c; } } - + /* * M a c r o E x p a n s i o n */ @@ -486,7 +486,7 @@ void expand(DEFBUF* tokenp) expstuff(tokenp); /* Do actual parameters */ } /* nargs switch */ } - + FILE_LOCAL int expcollect() /* @@ -547,7 +547,7 @@ expcollect() } /* Collect all args. */ return (TRUE); /* Normal return */ } - + FILE_LOCAL void expstuff(DEFBUF* tokenp) /* diff --git a/rsc/source/rscpp/cpp5.c b/rsc/source/rscpp/cpp5.c index 9c2cfe68f10b..4eb3183b5a86 100644 --- a/rsc/source/rscpp/cpp5.c +++ b/rsc/source/rscpp/cpp5.c @@ -114,7 +114,7 @@ register int op; #define isbinary(op) (op >= FIRST_BINOP && op <= LAST_BINOP) #define isunary(op) (op >= FIRST_UNOP && op <= LAST_UNOP) #endif - + /* * The following definitions are used to specify basic variable sizes. */ @@ -158,7 +158,7 @@ register int op; #ifndef S_PFPTR #define S_PFPTR (sizeof (int (*)())) #endif - + typedef struct types { short type; /* This is the bit if */ char *name; /* this is the token word */ @@ -203,7 +203,6 @@ SIZES size_table[] = { { T_FPTR, 0, S_PFPTR }, /* int (*()) */ { 0, 0, 0 }, /* End of table */ }; - void InitCpp5() { @@ -379,7 +378,7 @@ again: ; } /* op1 switch end */ } /* Stack unwind loop */ } - + FILE_LOCAL int evallex(int skip) /* @@ -662,7 +661,7 @@ evalnum(int c) unget(); return (value); } - + FILE_LOCAL int evalchar(int skip) /* @@ -768,7 +767,7 @@ evalchar(int skip) instring = FALSE; return (value); } - + FILE_LOCAL int * evaleval(int* valp, int op, int skip) /* @@ -906,7 +905,7 @@ evaleval(int* valp, int op, int skip) *valp++ = v1; return (valp); } - + #ifdef DEBUG_EVAL dumpstack(opstack, opp, value, valp) OPTAB opstack[NEXP]; /* Operand stack */ diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c index 360e3f75b25f..cb628ba4c04d 100644 --- a/rsc/source/rscpp/cpp6.c +++ b/rsc/source/rscpp/cpp6.c @@ -82,7 +82,7 @@ * cierror & ciwarn take a format and a single int (char) argument. * cfatal takes a format and a single string argument. */ - + /* * This table must be rewritten for a non-Ascii machine. * @@ -169,7 +169,6 @@ OP_LPA,OP_RPA,OP_MUL,OP_ADD, 000,OP_SUB, DOT,OP_DIV, /* 28 ()*+,-./ */ #endif - /* * C P P S y m b o l T a b l e s */ @@ -227,7 +226,7 @@ skipws() #endif return (c); } - + void scanid(int c) /* * Get the next token (an id) into the token buffer. @@ -268,7 +267,7 @@ macroid(int c) } return (c); } - + int catenate() /* @@ -334,7 +333,7 @@ catenate() return (FALSE); /* Not supported */ #endif } - + int scanstring(int delim, #ifndef _NO_PROTO @@ -373,7 +372,7 @@ void (*outfun)() /* BP */ return (FALSE); } } - + void scannumber(int c, #ifndef _NO_PROTO register void (*outfun)( int ) /* BP */ /* Output/store func */ @@ -503,7 +502,7 @@ nomore: unget(); /* Not part of a number */ if (octal89 && radix == 8) cwarn("Illegal digit in octal number", NULLST); } - + void save(int c) { if (workp >= &work[NWORK]) { @@ -564,7 +563,6 @@ getmem(int size) cfatal("Out of memory", NULLST); return (result); } - DEFBUF * lookid(int c) @@ -604,7 +602,7 @@ lookid(int c) } return ((temp == 0) ? dp : NULL); } - + DEFBUF * defendel(char* name, int delete) /* @@ -772,7 +770,7 @@ void dumpadef(char *why, register DEFBUF *dp) pCppOut = pRememberOut; } #endif - + /* * G E T */ @@ -1053,7 +1051,7 @@ cget() #endif return (c); } - + /* * Error messages and other hacks. The first byte of severity * is 'S' for string arguments and 'I' for int arguments. This diff --git a/rsc/source/rscpp/cppdef.h b/rsc/source/rscpp/cppdef.h index b3adecbc41cb..2490f1df7d7b 100644 --- a/rsc/source/rscpp/cppdef.h +++ b/rsc/source/rscpp/cppdef.h @@ -185,7 +185,7 @@ #ifndef LINE_PREFIX #define LINE_PREFIX "" #endif - + /* * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT, * COMMENT_INVISIBLE, and STRING_FORMAL to values appropriate for @@ -304,12 +304,7 @@ #else #define PAR_MAC (31 + 1) #endif -/* ER 13.06.95 19:33 - da Makros im file->buffer expandiert werden, muss NBUFF mindestens NWORK sein -#define NWORK 4096 -#define NBUFF 4096 - */ -/* ER 13.06.95 20:05 NWORK wg. grooossen Makros in *.src erhoeht, +/* NWORK wg. grooossen Makros in *.src erhoeht, da wir bald 10 Sprachen haben werden gleich ordentlich reingehauen.. */ #define NWORK 128000 #define NBUFF NWORK |