summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-14 06:31:20 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-14 06:31:20 +0000
commit4b69e29bb6b5b22df9799cb3ebafd95981077405 (patch)
tree6aac817dd3ae37c2f473a8346e2224e721a5a4bf /gcc
parentea2fde7c11345864bf1059b48951d567fe6e014d (diff)
downloadppe42-gcc-4b69e29bb6b5b22df9799cb3ebafd95981077405.tar.gz
ppe42-gcc-4b69e29bb6b5b22df9799cb3ebafd95981077405.zip
2000-02-13 Neil Booth <NeilB@earthling.net>
* cppfiles.c (read_and_prescan): When emitting deferred newlines, test speccase[] again instead of checking each possible whitespace character in turn. When we encounter \r, look behind for \n first, then ahead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31963 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cppfiles.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 99d6003dec9..21b8fc43275 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2000-02-13 Neil Booth <NeilB@earthling.net>
+
+ * cppfiles.c (read_and_prescan): When emitting deferred
+ newlines, test speccase[] again instead of checking each
+ possible whitespace character in turn. When we encounter \r,
+ look behind for \n first, then ahead.
+
2000-02-13 Zack Weinberg <zack@wolery.cumb.org>
* cse.c (cse_altered): New internal flag.
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index a00fb89e395..592cb6b9201 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -904,8 +904,9 @@ read_and_prescan (pfile, fp, desc, len)
memcpy (op, ip, span);
op += span;
ip += span;
- if (*ip == '\n' || *ip == '\t'
- || *ip == ' ' || *ip == ' ')
+ /* If ip[0] is SPECCASE_EMPTY, we have hit white space.
+ Dump out the remaining deferred \-newlines. */
+ if (speccase[ip[0]] == SPECCASE_EMPTY)
while (deferred_newlines)
deferred_newlines--, *op++ = '\r';
span = 0;
@@ -924,15 +925,15 @@ read_and_prescan (pfile, fp, desc, len)
goto read_next;
case SPECCASE_CR: /* \r */
- if (*ip == '\n')
+ if (ip[-2] == '\n')
+ continue;
+ else if (*ip == '\n')
ip++;
else if (*ip == '\0')
{
*--ibase = '\r';
goto read_next;
}
- else if (ip[-2] == '\n')
- continue;
*op++ = '\n';
break;
OpenPOWER on IntegriCloud