Refactor low-level printing for simplicity
commit96bfe816d8107003dba7fd824c2ac2b999a84ae9
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Apr 2015 15:53:35 +0000 (19 08:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Apr 2015 15:55:36 +0000 (19 08:55 -0700)
tree515ecdd0b9cd007a7b1a16c09ff69b6a8f46cd84
parent65ac8bc6a9e256b60c8ddfa3c99a1b28145a0763
Refactor low-level printing for simplicity

* src/print.c (PRINTDECLARE): Remove.  Move its contents into
PRINTPREPARE; doable now that we assume C99.  All callers changed.
(PRINTCHAR): Remove, as it adds more mystery than clarity.
All callers changed.
(strout): Assume that caller computes length.  All callers changed.
(print_c_string): New function.
(write_string, write_string_1): Compute length instead of asking
the caller to compute it.  All callers changed.
(write_string): Simplify by using write_string_1.
(write_string_1): Simplify by using print_c_string.
(Fterpri): Compute default val more clearly.
(Fprin1_to_string, print_object):
Assume C99 to avoid unnecessary nesting.
(print_object): Prefer print_c_string to multiple printchar, or
to calling strout with -1 length.  Coalesce into sprintf when
this is easy.
src/eval.c
src/lisp.h
src/print.c