This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Simplify c_parser_next_token_is_keyword


The following trivial patch simplifies c_parser_next_token_is_keyword
(so that it looks like c_parser_next_token_is a couple of lines above).

Bootstrapped and regtested on i686-pc-linux-gnu.
Ok for mainline?

Regards,
Volker

:ADDPATCH C:


2008-03-28  Volker Reichelt  <v.reichelt@netcologne.de>

	* c-parser.c (c_parser_next_token_is_keyword): Simplify.

===================================================================
--- gcc/c-parser.c  2006-08-06 01:08:54 +0200
+++ gcc/c-parser.c  2006-08-19 21:16:51 +0200
@@ -443,12 +443,7 @@ c_parser_next_token_is_not (c_parser *pa
 static inline bool
 c_parser_next_token_is_keyword (c_parser *parser, enum rid keyword)
 {
-  c_token *token;
-
-  /* Peek at the next token.  */
-  token = c_parser_peek_token (parser);
-  /* Check to see if it is the indicated keyword.  */
-  return token->keyword == keyword;
+  return c_parser_peek_token (parser)->keyword == keyword;
 }
 
 /* Return true if TOKEN can start a type name,
===================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]