summaryrefslogtreecommitdiff
path: root/libguile/r6rs-ports.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-04-04 11:03:52 +0200
committerAndy Wingo <wingo@pobox.com>2016-04-04 16:30:57 +0200
commit2caae477c55ed945555715150606a097d8b50f9b (patch)
tree457f4251155af83b9a2908248f52dfd2c2e7092b /libguile/r6rs-ports.c
parentb538a96f927d5a0079655bd6df8f019c008930ee (diff)
downloadguile-2caae477c55ed945555715150606a097d8b50f9b.tar.gz
Refactor to rw_random / rw_active port flags
* libguile/fports.c (fport_flush, fport_end_input): Move rw_active handling to ports.c. * libguile/ioext.c (scm_redirect_port): Use scm_flush_unlocked instead of calling the flush function directly. * libguile/ports.c (scm_c_make_port_with_encoding): Ports default to "rw_random" mode when they have a seek function. (scm_c_read_unlocked, scm_i_unget_bytes_unlocked) (scm_slow_get_byte_or_eof_unlocked) (scm_slow_peek_byte_or_eof_unlocked): Flush write buffer and set rw_active always in the same way, and only if rw_random is true. (scm_end_input_unlocked, scm_flush_unlocked): Clear rw_active here unconditionally. (scm_c_write_unlocked): Flush read buffer and set rw_active always in the same way, but only if rw_random is true. (scm_c_write, scm_lfwrite): Whitespace fixes. (scm_lfwrite_substr): Don't flush read buffer; lower-level code will do this. (scm_truncate_file): Use scm_flush_unlocked instead of calling the flush function directly. * libguile/r6rs-ports.c (transcoded_port_flush): Don't muck with rw_active. * libguile/read.c (scm_i_scan_for_encoding): Flush write buffer if needed in same way as ports.c. * libguile/strports.c (st_end_input): Don't muck with rw_active. (scm_mkstrport): rw_random defaults to 1 now.
Diffstat (limited to 'libguile/r6rs-ports.c')
-rw-r--r--libguile/r6rs-ports.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index 12e0cc7db..5a752bbc5 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -1233,7 +1233,6 @@ transcoded_port_flush (SCM port)
scm_c_write_unlocked (binary_port, c_port->write_buf, count);
c_port->write_pos = c_port->write_buf;
- c_port->rw_active = SCM_PORT_NEITHER;
if (SCM_OPOUTPORTP (binary_port))
scm_force_output (binary_port);