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

@@ -445,9 +445,8 @@ show_sub_message (const char* cp, bool explicit_bracketing,
_(", cannot be accessed from mid-rule action at $%d"),
midrule_rhs_index);
obstack_1grow (&msg_buf, '\0');
complain_at_indent (id_loc, wflags, &indent, "%s",
(char *) obstack_finish (&msg_buf));
obstack_finish0 (&msg_buf));
obstack_free (&msg_buf, 0);
}
}