Stage 10: avoid extra copying of strings and comments.
commit5d61bd60454bca489dc2f4eb4ee0d9eba4f1f425
authorEric Blake <ebb9@byu.net>
Fri, 26 Oct 2007 16:45:51 +0000 (26 10:45 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 17 Jan 2008 03:16:10 +0000 (16 20:16 -0700)
treea533ae93d749a3f886c6d51e8c1419cc5752958d
parentbf1bf749de4df7dcee7214ea01111b94be0db31e
Stage 10: avoid extra copying of strings and comments.

* m4/gnulib-cache.m4: Import the intprops and vasnprintf-posix
modules.
* src/m4.h (includes): Use new gnulib modules.
(next_token): Adjust prototype.
(bad_argc): New prototype.
* src/format.c (arg_int, arg_long, arg_double): New helper
functions.
(ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Track missing
arguments.
(format): Improve warnings, and avoid copying into obstack in the
common case.
* src/input.c (next_token): Add new parameter.
(lex_debug): Adjust caller.
* src/symtab.c (symtab_debug): Likewise.
* src/macro.c (expand_input, expand_token, expand_argument)
(collect_arguments): Likewise.
* src/output.c (m4_tmpname): Guarantee correct buffer size.
* src/builtin.c (builtin_init): Improve efficiency.
(bad_argc): Export.
(ntoa): Tighten buffer allocation.
* doc/m4.texinfo (Format): Test the improvements.
* NEWS: Document the improvement.

(cherry picked from commit 622fc8cb2cb6ce0fc7391a6414bb0aaffeec6fc0)

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
doc/m4.texinfo
m4/gnulib-cache.m4
src/builtin.c
src/format.c
src/input.c
src/m4.h
src/macro.c
src/output.c
src/symtab.c