mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 20:29:54 +08:00
cppfiles.c (read_and_prescan): When emitting deferred newlines...
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. From-SVN: r31963
This commit is contained in:
parent
4eadede7c1
commit
67b8719a74
@ -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>
|
2000-02-13 Zack Weinberg <zack@wolery.cumb.org>
|
||||||
|
|
||||||
* cse.c (cse_altered): New internal flag.
|
* cse.c (cse_altered): New internal flag.
|
||||||
|
@ -904,8 +904,9 @@ read_and_prescan (pfile, fp, desc, len)
|
|||||||
memcpy (op, ip, span);
|
memcpy (op, ip, span);
|
||||||
op += span;
|
op += span;
|
||||||
ip += span;
|
ip += span;
|
||||||
if (*ip == '\n' || *ip == '\t'
|
/* If ip[0] is SPECCASE_EMPTY, we have hit white space.
|
||||||
|| *ip == ' ' || *ip == ' ')
|
Dump out the remaining deferred \-newlines. */
|
||||||
|
if (speccase[ip[0]] == SPECCASE_EMPTY)
|
||||||
while (deferred_newlines)
|
while (deferred_newlines)
|
||||||
deferred_newlines--, *op++ = '\r';
|
deferred_newlines--, *op++ = '\r';
|
||||||
span = 0;
|
span = 0;
|
||||||
@ -924,15 +925,15 @@ read_and_prescan (pfile, fp, desc, len)
|
|||||||
goto read_next;
|
goto read_next;
|
||||||
|
|
||||||
case SPECCASE_CR: /* \r */
|
case SPECCASE_CR: /* \r */
|
||||||
if (*ip == '\n')
|
if (ip[-2] == '\n')
|
||||||
|
continue;
|
||||||
|
else if (*ip == '\n')
|
||||||
ip++;
|
ip++;
|
||||||
else if (*ip == '\0')
|
else if (*ip == '\0')
|
||||||
{
|
{
|
||||||
*--ibase = '\r';
|
*--ibase = '\r';
|
||||||
goto read_next;
|
goto read_next;
|
||||||
}
|
}
|
||||||
else if (ip[-2] == '\n')
|
|
||||||
continue;
|
|
||||||
*op++ = '\n';
|
*op++ = '\n';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user