From: "Jan Pokorný" <pokorny_jan@seznam.cz>
To: sparse@chrisli.org
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH 2/4] more transparent dealing with tokens/position
Date: Tue, 12 Apr 2011 13:25:55 +0200 [thread overview]
Message-ID: <4DA436C3.8060602@seznam.cz> (raw)
In-Reply-To: <4DA4352D.6040602@seznam.cz>
Unify usage of `eof_token', version with respective asserts,
mainly intended for convenient testing.
Signed-off-by: Jan Pokorny <pokorny_jan@seznam.cz>
---
pre-process.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pre-process.c b/pre-process.c
index 603cc00..cee3d29 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -19,6 +19,7 @@
#include <fcntl.h>
#include <limits.h>
#include <time.h>
+#include <assert.h>
#include "lib.h"
#include "allocate.h"
@@ -794,11 +795,13 @@ out:
static int free_preprocessor_line(struct token *token)
{
- while (token_type(token) != TOKEN_EOF) {
+ while (!eof_token(token)) {
+ assert(token_type(token) != TOKEN_EOF);
struct token *free = token;
token = token->next;
__free_token(free);
};
+ assert(token_type(token) == TOKEN_EOF);
return 1;
}
--
1.7.1
prev parent reply other threads:[~2011-04-12 11:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 11:01 [PATCH 1/4] more transparent dealing with tokens/position Jan Pokorný
2011-04-12 11:19 ` [PATCH 2/4] " 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 ` Jan Pokorný [this message]
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=4DA436C3.8060602@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).