aboutsummaryrefslogtreecommitdiffstats
path: root/example.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-03 18:36:00 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-03 18:36:00 -0700
commit2c36119df5a9bf9ad04f665961721fdeb7ca7551 (patch)
tree295dc51738bf051de50b581c7ccb5c5fe220e146 /example.c
parent29d1ef3aac738226ede774080852bd3191804235 (diff)
downloadsparse-2c36119df5a9bf9ad04f665961721fdeb7ca7551.tar.gz
Update the calling interface to "sparse()".
Start off with sparse_initialize(argc, argv); which will return the number of filenames found. You can then use that, or just check if *argv is NULL in a loop like while (*argv) list = sparse(argv); where you get the declaration list for each file in turn.
Diffstat (limited to 'example.c')
-rw-r--r--example.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/example.c b/example.c
index 538bc9a3..139f518a 100644
--- a/example.c
+++ b/example.c
@@ -1587,7 +1587,7 @@ static void fill_output(struct bb_state *state, pseudo_t pseudo, struct storage
default:
if (out == in->storage)
break;
- if (out->type == in->storage->type == out->regno == in->storage->regno)
+ if ((out->type == in->storage->type) && (out->regno == in->storage->regno))
break;
output_insn(state, "movl %s,%s", show_memop(in->storage), show_memop(out));
break;
@@ -1958,6 +1958,9 @@ static int compile(struct symbol_list *list)
int main(int argc, char **argv)
{
- return compile(sparse(argc, argv));
+ sparse_initialize(argc, argv);
+ while (*argv)
+ compile(sparse(argv));
+ return 0;
}