summaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-06-24 23:09:17 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-06-24 23:09:17 +0000
commit9941aaa1e4c9b5edf47dee220b9a3e49a246f116 (patch)
tree282e9081f6ca963a42c4844c3c68a9066d9b28b9 /gcc/cccp.c
parent91e062a0392307fc56a7a0e2f76f091fbc1c14bc (diff)
downloadgcc-9941aaa1e4c9b5edf47dee220b9a3e49a246f116.tar.gz
(create_definition): Eliminate whitespace before and after macro
definitions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 60e5f15995a..beabe383b24 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -5333,8 +5333,9 @@ create_definition (buf, limit, op)
}
++bp; /* skip paren */
- /* Skip exactly one space or tab if any. */
- if (bp < limit && (*bp == ' ' || *bp == '\t')) ++bp;
+ /* Skip spaces and tabs if any. */
+ while (bp < limit && (*bp == ' ' || *bp == '\t'))
+ ++bp;
/* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, argno, arg_ptrs);
defn->rest_args = rest_args;
@@ -5357,10 +5358,12 @@ create_definition (buf, limit, op)
defn->args.argnames[i] = 0;
}
} else {
- /* simple expansion or empty definition; gobble it */
- if (is_hor_space[*bp])
- ++bp; /* skip exactly one blank/tab char */
- /* now everything from bp before limit is the definition. */
+ /* Simple expansion or empty definition. */
+
+ /* Skip spaces and tabs if any. */
+ while (bp < limit && (*bp == ' ' || *bp == '\t'))
+ ++bp;
+ /* Now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) "";
}
@@ -5818,20 +5821,6 @@ collect_expansion (buf, end, nargs, arglist)
}
}
- if (limit < end) {
- /* Convert trailing whitespace to Newline-markers. */
- while (limit < end && is_space[*limit]) {
- *exp_p++ = '\n';
- *exp_p++ = *limit++;
- }
- } else if (!traditional && expected_delimiter == 0) {
- /* There is no trailing whitespace, so invent some in ANSI mode.
- But not if "inside a string" (which in ANSI mode
- happens only for -D option). */
- *exp_p++ = '\n';
- *exp_p++ = ' ';
- }
-
*exp_p = '\0';
defn->length = exp_p - defn->expansion;