wingo pushed a commit to branch wip-port-refactor
in repository guile.
commit fe7ceff9691e20723d466542b3ff4132d78f2a3b
Author: Andy Wingo <[email protected]>
Date: Fri May 13 10:16:27 2016 +0200
Remove SCM backlink in port structure
* libguile/ports.h (scm_t_port): Remove port backlink.
* libguile/ports.c (scm_c_make_port_with_encoding, scm_fill_input)
(scm_seek): Adapt.
---
libguile/ports.c | 7 +++----
libguile/ports.h | 3 ---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/libguile/ports.c b/libguile/ports.c
index a2509fb..6003129 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -735,7 +735,6 @@ scm_c_make_port_with_encoding (scm_t_bits tag, unsigned
long mode_bits,
entry->internal = pti;
entry->file_name = SCM_BOOL_F;
- entry->port = ret;
entry->stream = stream;
entry->encoding = encoding;
entry->conversion_strategy = conversion_strategy;
@@ -2455,7 +2454,7 @@ scm_fill_input (SCM port, size_t minimum_size)
return read_buf;
if (pt->rw_random)
- scm_flush (pt->port);
+ scm_flush (port);
/* Prepare to read. Make sure there is enough space in the buffer for
minimum_size, and ensure that cur is zero so that we fill towards
@@ -2874,8 +2873,8 @@ SCM_DEFINE (scm_seek, "seek", 3, 0, 0,
/* FIXME: Avoid flushing buffers for SEEK_CUR with an offset of
0. */
- scm_end_input (pt->port);
- scm_flush (pt->port);
+ scm_end_input (fd_port);
+ scm_flush (fd_port);
rv = ptob->seek (fd_port, off, how);
diff --git a/libguile/ports.h b/libguile/ports.h
index f9b6389..84f4e01 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -81,9 +81,6 @@ enum scm_port_buffer_field {
typedef struct
{
- /* Link back to the port object. */
- SCM port;
-
/* Pointer to internal-only port structure. */
struct scm_port_internal *internal;