diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-03-06 12:45:41 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@loeliger.com> | 2008-03-23 08:00:33 -0500 |
commit | 8a88ad8badfe54d91b35c5da25889de0db54f43e (patch) | |
tree | b3966433a4ac369d7ed12067f6c1abe1eb053669 /srcpos.h | |
parent | f7ea3708c38bd38851baafa83e98d95602e53cbc (diff) | |
download | dtc-8a88ad8badfe54d91b35c5da25889de0db54f43e.tar.gz |
dtc: Remove ugly include stack abuse
Currently, dt_from_source() uses push_input_file() to set up the
initial input file for the lexer. That sounds sensible - put the
outermost input file at the bottom of the stack - until you realise
that what it *actually* does is pushes the current, uninitialized,
lexer input state onto the stack, then sets up the new lexer input.
That necessitates an extra check in pop_input_file(), rather than
signalling termination in the natural way when the include stack is
empty, it has to check when it pops the bogus uninitialized state off
the stack. Ick.
With that fixed, push_input_file(), pop_input_file() and
incl_file_stack itself become local to the lexer, so make them static.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'srcpos.h')
-rw-r--r-- | srcpos.h | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -75,9 +75,6 @@ extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2))); extern struct dtc_file *srcpos_file; -extern void push_input_file(const char *filename); -extern int pop_input_file(void); - struct search_path { const char *dir; /* NULL for current directory */ struct search_path *prev, *next; |