Re: [PATCH 2/4] more transparent dealing with tokens/position

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Unify usage of `eof_token', version with respective asserts,
mainly intended for convenient testing.

Signed-off-by: Jan Pokorny <pokorny_jan@xxxxxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux