diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-07 16:17:17 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:19 -0700 |
| commit | 5c5a1976c174c787d0df4ed7746ad6951320b102 (patch) | |
| tree | ed5388399e158e3aeae663446277cf4da0858a1c /test-parsing.c | |
| parent | bcf2e43315f7d37189eee548a3636ca5d322f3eb (diff) | |
| download | sparse-dev-5c5a1976c174c787d0df4ed7746ad6951320b102.tar.gz | |
Clean up: mark local stuff 'static', and remove unused function.
Use the "used_list" to build up the symbol tree, so that we
automatically get new symbols that get discovered during
evaluation.
Diffstat (limited to 'test-parsing.c')
| -rw-r--r-- | test-parsing.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/test-parsing.c b/test-parsing.c index 204f6138..8002f89a 100644 --- a/test-parsing.c +++ b/test-parsing.c @@ -19,8 +19,8 @@ #include "symbol.h" #include "expression.h" -unsigned int pre_buffer_size = 0; -unsigned char pre_buffer[8192]; +static unsigned int pre_buffer_size = 0; +static unsigned char pre_buffer[8192]; static void add_pre_buffer(const char *fmt, ...) { @@ -65,12 +65,7 @@ static void handle_switch(char *arg) } } -void clean_up_statement(struct statement *stmt, void *_parent, int flags) -{ - evaluate_statement(stmt); -} - -void clean_up_symbol(struct symbol *sym, void *_parent, int flags) +static void clean_up_symbol(struct symbol *sym, void *_parent, int flags) { evaluate_symbol(sym); } @@ -80,7 +75,6 @@ int main(int argc, char **argv) int i, fd; char *filename = NULL; struct token *token; - struct symbol_list *list = NULL; // Initialize symbol stream first, so that we can add defines etc init_symbols(); @@ -114,14 +108,14 @@ int main(int argc, char **argv) token = preprocess(token); // Parse the resulting C code - translation_unit(token, &list); + translation_unit(token, &used_list); // Do type evaluation and simplify - symbol_iterate(list, clean_up_symbol, NULL); + symbol_iterate(used_list, clean_up_symbol, NULL); #if 1 // Show the end result. - show_symbol_list(list, "\n\n"); + show_symbol_list(used_list, "\n\n"); printf("\n\n"); #endif |
