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

@@ -155,8 +155,7 @@ print_state (state *s, FILE *fgraph)
/* A node's label contains its items. */
obstack_init (&node_obstack);
print_core (&node_obstack, s);
obstack_1grow (&node_obstack, '\0');
output_node (s->number, obstack_finish (&node_obstack), fgraph);
output_node (s->number, obstack_finish0 (&node_obstack), fgraph);
obstack_free (&node_obstack, 0);
/* Output the edges. */