aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Li <sparse@chrisli.org>2006-11-30 02:11:36 -0800
committerJosh Triplett <josh@freedesktop.org>2006-12-04 23:27:58 -0800
commit4ad8ad708f80c91e70f8491e4d62dccc40358887 (patch)
tree7d09aa58e537095a1567568913ab233408dfc835 /test-parsing.c
parentdelay removing file scope (diff)
downloadsparse-4ad8ad708f80c91e70f8491e4d62dccc40358887.tar.gz
sparse-4ad8ad708f80c91e70f8491e4d62dccc40358887.tar.bz2
sparse-4ad8ad708f80c91e70f8491e4d62dccc40358887.zip
cleanup write to argument array hack
The sparse interface is a kind of snaky that it change the input argument array. The function sparse() does the same hack just to skip the files. This patch add the ptr list for string. So sparse_initialize will return list of file to compile. The string pointer is not aligned at word boundary. This patch introduce non taged version of the ptr list iteration function. Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'test-parsing.c')
-rw-r--r--test-parsing.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test-parsing.c b/test-parsing.c
index 5aafae9..f29a730 100644
--- a/test-parsing.c
+++ b/test-parsing.c
@@ -35,8 +35,10 @@ static void clean_up_symbols(struct symbol_list *list)
int main(int argc, char **argv)
{
struct symbol_list * list;
+ struct string_list * filelist = NULL;
+ char *file;
- list = sparse_initialize(argc, argv);
+ list = sparse_initialize(argc, argv, &filelist);
// Simplification
clean_up_symbols(list);
@@ -46,8 +48,8 @@ int main(int argc, char **argv)
printf("\n\n");
#endif
- while (*argv) {
- list = sparse(argv);
+ FOR_EACH_PTR_NOTAG(filelist, file) {
+ list = sparse(file);
// Simplification
clean_up_symbols(list);
@@ -57,7 +59,7 @@ int main(int argc, char **argv)
show_symbol_list(list, "\n\n");
printf("\n\n");
#endif
- }
+ } END_FOR_EACH_PTR_NOTAG(file);
#if 0
// And show the allocation statistics