From d8508c2754622b7c3d7196aa9261f82ed29982b5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 5 Aug 2015 07:17:25 -0700 Subject: * stream.c (width_check): Just use the public put_char function; no need to manipulate column or call put_indent. --- ChangeLog | 6 ++++++ stream.c | 15 ++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb529b7d..aa7075e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-08-05 Kaz Kylheku + + * stream.c (width_check): Just use the public + put_char function; no need to manipulate column + or call put_indent. + 2015-08-05 Kaz Kylheku Better diagnostic in funcall family of functions. diff --git a/stream.c b/stream.c index 6f8db48f..514b7140 100644 --- a/stream.c +++ b/stream.c @@ -2747,24 +2747,17 @@ val inc_indent(val stream, val delta) val width_check(val stream, val alt) { - struct strm_ops *ops = coerce(struct strm_ops *, cobj_ops(stream, stream_s)); - struct strm_base *s = coerce(struct strm_base *, stream->co.handle); + struct strm_base *s = coerce(struct strm_base *, + cobj_handle(stream, stream_s)); if ((s->indent_mode == indent_code && s->column >= s->indent_chars + s->code_width) || (s->indent_mode == indent_data && s->column >= s->indent_chars + s->data_width)) { - if (ops->put_char(stream, chr('\n')) && - put_indent(stream, ops, s->indent_chars)) { - s->column = s->indent_chars; - return t; - } - return nil; + put_char(chr('\n'), stream); } else if (alt) { - ops->put_char(stream, alt); - s->column++; - return t; + put_char(alt, stream); } return t; -- cgit v1.2.3