[hackers] [scc] [cc1] Simplify comment() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 23 Jun 2016 08:52:30 +0200 (CEST)

commit 18ab3f16b5df956072ca9de86967136e5dbdc330
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Jun 23 08:51:56 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Jun 23 08:51:56 2016 +0200

    [cc1] Simplify comment()

diff --git a/cc1/lex.c b/cc1/lex.c
index 946af62..7e51d8d 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -166,18 +166,14 @@ comment(int type)
         c = -1;
 repeat:
         do {
- if (!c)
- goto unterminated;
- } while (!eof && (c = readchar()) != type);
+ if (!c || eof) {
+ errorp("unterminated comment");
+ return;
+ }
+ } while ((c = readchar()) != type);
 
- if (eof)
- goto unterminated;
         if (type == '*' && (c = readchar()) != '/')
                 goto repeat;
- return;
-
-unterminated:
- errorp("unterminated comment");
 }
 
 static int
Received on Thu Jun 23 2016 - 08:52:30 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 23 2016 - 09:00:17 CEST