All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Pokorný" <pokorny_jan@seznam.cz>
To: sparse@chrisli.org
Cc: linux-sparse@vger.kernel.org
Subject: [PATCH 1/4] more transparent dealing with tokens/position
Date: Tue, 12 Apr 2011 13:01:13 +0200	[thread overview]
Message-ID: <4DA430F9.3070709@seznam.cz> (raw)

Unify usage of `token_type'.

Signed-off-by: Jan Pokorny <pokorny_jan@seznam.cz>
---
 expression.h |    2 +-
 token.h      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/expression.h b/expression.h
index 9778de8..480079c 100644
--- a/expression.h
+++ b/expression.h
@@ -200,7 +200,7 @@ struct token *typename(struct token *, struct symbol **, int *);
 
 static inline int lookup_type(struct token *token)
 {
-	if (token->pos.type == TOKEN_IDENT) {
+	if (token_type(token) == TOKEN_IDENT) {
 		struct symbol *sym = lookup_symbol(token->ident, NS_SYMBOL | NS_TYPEDEF);
 		return sym && (sym->namespace & NS_TYPEDEF);
 	}
diff --git a/token.h b/token.h
index a7ec77e..a3c194d 100644
--- a/token.h
+++ b/token.h
@@ -205,12 +205,12 @@ extern struct token *preprocess(struct token *);
 
 static inline int match_op(struct token *token, int op)
 {
-	return token->pos.type == TOKEN_SPECIAL && token->special == op;
+	return token_type(token) == TOKEN_SPECIAL && token->special == op;
 }
 
 static inline int match_ident(struct token *token, struct ident *id)
 {
-	return token->pos.type == TOKEN_IDENT && token->ident == id;
+	return token_type(token) == TOKEN_IDENT && token->ident == id;
 }
 
 #endif
-- 
1.7.1

             reply	other threads:[~2011-04-12 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 11:01 Jan Pokorný [this message]
2011-04-12 11:19 ` [PATCH 2/4] more transparent dealing with tokens/position Jan Pokorný
2011-04-12 11:22   ` [PATCH 3/4] " Jan Pokorný
2011-04-12 11:23     ` [PATCH 4/4] " Jan Pokorný
2011-04-12 11:25   ` [PATCH 2/4] " Jan Pokorný

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA430F9.3070709@seznam.cz \
    --to=pokorny_jan@seznam.cz \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.