summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-09-18 10:09:43 +0200
committerNoel Grandin <noel@peralex.com>2014-09-19 08:36:54 +0200
commit2b97ae3221f9759f6253540214e9ff2a52a76efb (patch)
tree7d0c96bdac345a2ce13d167d26783e8e5e549fa7
parent80bdaac0a6d26fc249c9e79ae1c1eacc770cd783 (diff)
rsc: remove unused OLD_PREPROCESSOR
and consequently unused OK_DOLLAR OK_CONCAT COMMENT_INVISIBLE STRING_FORMAL Change-Id: I801b98be8a2fc04b7568fabff9aad486356a69c9
-rw-r--r--rsc/source/rscpp/cpp.h8
-rw-r--r--rsc/source/rscpp/cpp1.c15
-rw-r--r--rsc/source/rscpp/cpp2.c11
-rw-r--r--rsc/source/rscpp/cpp4.c53
-rw-r--r--rsc/source/rscpp/cpp6.c25
-rw-r--r--rsc/source/rscpp/cppdef.h66
6 files changed, 0 insertions, 178 deletions
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index b9fde72bed48..250b0dc1eb51 100644
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -209,12 +209,8 @@ typedef struct sizes {
#ifdef nomacarg
#define cput output /* cput concatenates tokens */
#else
-#if COMMENT_INVISIBLE
-#define cput(c) { if (c != TOK_SEP && c != COM_SEP) PUTCHAR(c); }
-#else
#define cput(c) { if (c != TOK_SEP) PUTCHAR(c); }
#endif
-#endif
#ifndef nomacarg
#define streq(s1, s2) (strcmp(s1, s2) == 0)
@@ -340,11 +336,7 @@ void checkparm( int c, DEFBUF *dp );
int expcollect(void);
void expstuff( DEFBUF *dp );
-#if STRING_FORMAL
-void stparmscan( int delim, DEFBUF *dp);
-#else
void stparmscan( int delim);
-#endif
#if OSL_DEBUG_LEVEL > 1
void dumpparm( char *why );
#endif
diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c
index 6265d59dfebd..a5bdd2b5bb37 100644
--- a/rsc/source/rscpp/cpp1.c
+++ b/rsc/source/rscpp/cpp1.c
@@ -338,11 +338,7 @@ int MAIN(int argc, char** argv)
if ((i = (ifptr - &ifstack[0])) != 0)
{
-#if OLD_PREPROCESSOR
- ciwarn("Inside #ifdef block at end of input, depth = %d", i);
-#else
cierror("Inside #ifdef block at end of input, depth = %d", i);
-#endif
}
#if OSL_DEBUG_LEVEL > 1
if( pDefOut != stdout && pDefOut != stderr )
@@ -458,9 +454,6 @@ void cppmain()
{ /* Token concat. loop */
for (counter = 0; type[(c = get())] == SPA;)
{
-#if COMMENT_INVISIBLE
- if (c != COM_SEP)
-#endif
counter++; /* Skip over blanks */
}
@@ -538,11 +531,7 @@ void cppmain()
*/
void output(int c)
{
-#if COMMENT_INVISIBLE
- if (c != TOK_SEP && c != COM_SEP)
-#else
if (c != TOK_SEP)
-#endif
PUTCHAR(c);
}
@@ -553,11 +542,7 @@ void output(int c)
*/
int outputEval(int c)
{
-#if COMMENT_INVISIBLE
- if (c != TOK_SEP && c != COM_SEP)
-#else
if (c != TOK_SEP)
-#endif
{
PUTCHAR(c);
if ( bIsInEval && nEvalOff < NEVALBUF )
diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c
index 7ff7cf216d7b..71db0c359b58 100644
--- a/rsc/source/rscpp/cpp2.c
+++ b/rsc/source/rscpp/cpp2.c
@@ -280,19 +280,10 @@ nest_err: cerror("#%s must be in an #if", token);
break;
}
if (hash != L_include) {
-#if OLD_PREPROCESSOR
- /*
- * Ignore the rest of the #control line so you can write
- * #if foo
- * #endif foo
- */
- goto dump_line; /* Take common exit */
-#else
if (skipws() != '\n') {
cwarn("Unexpected text in #control line ignored", NULLST);
skipnl();
}
-#endif
}
return (counter + 1);
}
@@ -335,10 +326,8 @@ void doif(int hash)
return;
badif: cerror("#if, #ifdef, or #ifndef without an argument", NULLST);
-#if !OLD_PREPROCESSOR
skipnl(); /* Prevent an extra */
unget(); /* Error message */
-#endif
return;
}
diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c
index 087f15fbccfe..0925cafdd45f 100644
--- a/rsc/source/rscpp/cpp4.c
+++ b/rsc/source/rscpp/cpp4.c
@@ -127,18 +127,11 @@ void dodefine()
workp = work; /* Replacement put here */
inmacro = TRUE; /* Keep \<newline> now */
while (c != EOF_CHAR && c != '\n') { /* Compile macro body */
-#if OK_CONCAT
-#if COMMENT_INVISIBLE
- if (c == COM_SEP) { /* Token concatenation? */
- save(TOK_SEP); /* Stuff a delimiter */
- c = get();
-#else
if (c == '#') { /* Token concatenation? */
while (workp > work && type[(int)workp[-1]] == SPA)
--workp; /* Erase leading spaces */
save(TOK_SEP); /* Stuff a delimiter */
c = skipws(); /* Eat whitespace */
-#endif
if (type[c] == LET) /* Another token here? */
; /* Stuff it normally */
else if (type[c] == DIG) { /* Digit string after? */
@@ -149,13 +142,10 @@ void dodefine()
save(TOK_SEP); /* Delimit 2nd token */
}
else {
-#if ! COMMENT_INVISIBLE
ciwarn("Strange character after # (%d.)", c);
-#endif
}
continue;
}
-#endif
switch (type[c]) {
case LET:
checkparm(c, dp); /* Might be a formal */
@@ -167,11 +157,7 @@ void dodefine()
break;
case QUO: /* String in mac. body */
-#if STRING_FORMAL
- stparmscan(c, dp); /* Do string magic */
-#else
stparmscan(c);
-#endif
break;
case BSH: /* Backslash */
@@ -258,44 +244,6 @@ void checkparm(int c, DEFBUF* dp)
save(*cp++); /* The token itself */
}
-#if STRING_FORMAL
-void stparmscan(delim, dp)
-int delim;
-DEFBUF *dp;
-/*
- * Scan the string (starting with the given delimiter).
- * The token is replaced if it is the only text in this string or
- * character constant. The algorithm follows checkparm() above.
- * Note that scanstring() has approved of the string.
- */
-{
- int c;
-
- /*
- * Warning -- this code hasn't been tested for a while.
- * It exists only to preserve compatibility with earlier
- * implementations of cpp. It is not part of the Draft
- * ANSI Standard C language.
- */
- save(delim);
- instring = TRUE;
- while ((c = get()) != delim
- && c != '\n'
- && c != EOF_CHAR) {
- if (type[c] == LET) /* Maybe formal parm */
- checkparm(c, dp);
- else {
- save(c);
- if (c == '\\')
- save(get());
- }
- }
- instring = FALSE;
- if (c != delim)
- cerror("Unterminated string in macro body", NULLST);
- save(c);
-}
-#else
void stparmscan(int delim)
/*
* Normal string parameter scan.
@@ -328,7 +276,6 @@ void stparmscan(int delim)
}
workp[-1] = wp[-1]; /* Nope, reset end quote. */
}
-#endif
void doundef()
/*
diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c
index 963676d597cf..45297a25825b 100644
--- a/rsc/source/rscpp/cpp6.c
+++ b/rsc/source/rscpp/cpp6.c
@@ -87,11 +87,7 @@
<< error type table is not correct >>
#endif
-#if OK_DOLLAR
#define DOL LET
-#else
-#define DOL 000
-#endif
#ifdef EBCDIC
@@ -211,11 +207,7 @@ skipws()
do { /* Skip whitespace */
c = get();
-#if COMMENT_INVISIBLE
- } while (type[c] == SPA || c == COM_SEP);
-#else
} while (type[c] == SPA);
-#endif
return (c);
}
@@ -273,7 +265,6 @@ catenate()
int c;
char *token1;
-#if OK_CONCAT
if (get() != TOK_SEP) { /* Token concatenation */
unget();
return (FALSE);
@@ -301,12 +292,10 @@ catenate()
break;
default: /* An error, ... */
-#if ! COMMENT_INVISIBLE
if (isprint(c))
cierror("Strange character '%c' after #", c);
else
cierror("Strange character (%d.) after #", c);
-#endif
strcpy(work, token1);
unget();
break;
@@ -321,9 +310,6 @@ catenate()
ungetstring(work); /* Unget the new thing, */
return (TRUE);
}
-#else
- return (FALSE); /* Not supported */
-#endif
}
int
@@ -927,14 +913,7 @@ newline:
if (*file->bptr == '\n'
|| type[*file->bptr & 0xFF] == SPA)
goto newline;
-#if COMMENT_INVISIBLE
- /*
- * Return magic (old-fashioned) syntactic space.
- */
- return ((file->bptr[-1] = COM_SEP));
-#else
return ((file->bptr[-1] = ' '));
-#endif
case '\n': /* we'll need a #line */
if (!keepcomments)
@@ -1036,11 +1015,7 @@ cget()
do {
c = get();
-#if COMMENT_INVISIBLE
- } while (c == TOK_SEP || c == COM_SEP);
-#else
} while (c == TOK_SEP);
-#endif
return (c);
}
diff --git a/rsc/source/rscpp/cppdef.h b/rsc/source/rscpp/cppdef.h
index 887502ddc5eb..274d60c4ccd2 100644
--- a/rsc/source/rscpp/cppdef.h
+++ b/rsc/source/rscpp/cppdef.h
@@ -74,15 +74,6 @@
* to be marked "static" even though they are referenced
* by "extern" statements elsewhere.
*
- * OK_DOLLAR Should be set TRUE if $ is a valid alphabetic character
- * in identifiers (default), or zero if $ is invalid.
- * Default is TRUE.
- *
- * OK_CONCAT Should be set TRUE if # may be used to concatenate
- * tokens in macros (per the Ansi Draft Standard) or
- * FALSE for old-style # processing (needed if cpp is
- * to process assembler source code).
- *
* OK_DATE Predefines the compilation date if set TRUE.
* Not permitted by the Nov. 12, 1984 Draft Standard.
*
@@ -116,24 +107,6 @@
#endif
/*
- * OLD_PREPROCESSOR forces the definition of OK_DOLLAR, OK_CONCAT,
- * COMMENT_INVISIBLE, and STRING_FORMAL to values appropriate for
- * an old-style preprocessor.
- */
-
-#ifndef OLD_PREPROCESSOR
-#define OLD_PREPROCESSOR FALSE
-#endif
-
-#if OLD_PREPROCESSOR
-#define OK_DOLLAR FALSE
-#define OK_CONCAT TRUE
-#define COMMENT_INVISIBLE TRUE
-#define STRING_FORMAL TRUE
-#define IDMAX 63 /* actually, seems to be unlimited */
-#endif
-
-/*
* RECURSION_LIMIT may be set to -1 to disable the macro recursion test.
*/
#ifndef RECURSION_LIMIT
@@ -149,45 +122,6 @@
#endif
/*
- * COMMENT_INVISIBLE may be defined to allow "old-style" comment
- * processing, whereby the comment becomes a zero-length token
- * delimiter. This permitted tokens to be concatenated in macro
- * expansions. This was removed from the Draft Ansi Standard.
- */
-#ifndef COMMENT_INVISIBLE
-#define COMMENT_INVISIBLE FALSE
-#endif
-
-/*
- * STRING_FORMAL may be defined to allow recognition of macro parameters
- * anywhere in replacement strings. This was removed from the Draft Ansi
- * Standard and a limited recognition capability added.
- */
-#ifndef STRING_FORMAL
-#define STRING_FORMAL FALSE
-#endif
-
-/*
- * OK_DOLLAR enables use of $ as a valid "letter" in identifiers.
- * This is a permitted extension to the Ansi Standard and is required
- * for e.g., RSX-11M, etc. It should be set FALSE if cpp is
- * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR
- * sets OK_DOLLAR FALSE for that reason.
- */
-#ifndef OK_DOLLAR
-#define OK_DOLLAR TRUE
-#endif
-
-/*
- * OK_CONCAT enables (one possible implementation of) token concatenation.
- * If cpp is used to preprocess Unix assembler source, this should be
- * set FALSE as the concatenation character, #, is used by the assembler.
- */
-#ifndef OK_CONCAT
-#define OK_CONCAT TRUE
-#endif
-
-/*
* OK_DATE may be enabled to predefine today's date as a string
* at the start of each compilation. This is apparently not permitted
* by the Draft Ansi Standard.