obstacks: simplifications

* src/system.h (obstack_finish0): New.
Use it to simplify several uses.
* src/muscle-tab.h (MUSCLE_INSERTF): New.
* src/muscle-tab.c: Use obstack_printf where simpler.
This commit is contained in:
Akim Demaille
2012-08-11 09:02:19 +02:00
parent c7324354fb
commit 6fbe73b6a0
10 changed files with 37 additions and 72 deletions

View File

@@ -86,10 +86,7 @@ static struct obstack obstack_for_string;
obstack_grow (&obstack_for_string, yytext, yyleng)
# define STRING_FINISH \
do { \
obstack_1grow (&obstack_for_string, '\0'); \
last_string = obstack_finish (&obstack_for_string); \
} while (0)
(last_string = obstack_finish0 (&obstack_for_string))
# define STRING_FREE \
obstack_free (&obstack_for_string, last_string)