diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-12-09 11:55:30 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:46 -0700 |
| commit | b4dcd7de02472d98ce22dd334b0a1bd5aa86717c (patch) | |
| tree | 0135570cb2398e9ae8d6bbc069d891e50e55d5b2 /pre-process.c | |
| parent | fd46a87b9e1d032863c41f54009e5e6386862f8b (diff) | |
| download | sparse-dev-b4dcd7de02472d98ce22dd334b0a1bd5aa86717c.tar.gz | |
Add "stream_name()" helper function, and use it.
Much prettier than "input_streams[x].name", since most
users really don't want to know about the internals of
how the preprocessor lays out its stream tracking.
Diffstat (limited to 'pre-process.c')
| -rw-r--r-- | pre-process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pre-process.c b/pre-process.c index 0a24f56e..c502074d 100644 --- a/pre-process.c +++ b/pre-process.c @@ -131,7 +131,7 @@ static int expand_one_symbol(struct token **list) if (token->ident == &__LINE___ident) { replace_with_integer(token, token->pos.line); } else if (token->ident == &__FILE___ident) { - replace_with_string(token, (input_streams + token->pos.stream)->name); + replace_with_string(token, stream_name(token->pos.stream)); } return 1; } @@ -601,7 +601,7 @@ static int already_tokenized(const char *path) int i; struct stream *s = input_streams; - for (i = input_stream_nr-1; i >= 0; i--, s++) { + for (i = input_stream_nr; --i >= 0; s++) { if (s->constant != CONSTANT_FILE_YES) continue; if (strcmp(path, s->name)) |
