summaryrefslogtreecommitdiff
path: root/libguile/r6rs-ports.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-05-14 12:38:49 +0200
committerAndy Wingo <wingo@pobox.com>2016-05-14 12:42:17 +0200
commit9ecf77a82d6060a26f6891181f4582cc19dec65e (patch)
tree4f9b55e6026841a380c9e3f1c95a6b2a39a9547d /libguile/r6rs-ports.c
parent9322902d02ecc23ec4c8534dbbc03c3074b78217 (diff)
Add SCM_OPN to mode bits when making ports
* libguile/ports.c (scm_c_make_port_with_encoding): Add SCM_OPN to mode bits, so that users don't have to. (scm_i_mode_bits_n): * libguile/print.c (scm_simple_format) * libguile/r6rs-ports.c (make_bytevector_input_port) (make_custom_binary_input_port, make_bytevector_output_port) (make_custom_binary_output_port, make_transcoded_port) * libguile/strports.c (scm_object_to_string, scm_open_input_string) (scm_open_output_string, scm_c_read_string): Remove now-unneeded SCM_OPN mentions.
Diffstat (limited to 'libguile/r6rs-ports.c')
-rw-r--r--libguile/r6rs-ports.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index 7b18d8294..c53b53bf2 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -92,7 +92,7 @@ struct bytevector_input_port {
static inline SCM
make_bytevector_input_port (SCM bv)
{
- const unsigned long mode_bits = SCM_OPN | SCM_RDNG;
+ const unsigned long mode_bits = SCM_RDNG;
struct bytevector_input_port *stream;
stream = scm_gc_typed_calloc (struct bytevector_input_port);
@@ -266,7 +266,7 @@ make_custom_binary_input_port (SCM read_proc, SCM get_position_proc,
SCM set_position_proc, SCM close_proc)
{
struct custom_binary_port *stream;
- const unsigned long mode_bits = SCM_OPN | SCM_RDNG;
+ const unsigned long mode_bits = SCM_RDNG;
stream = scm_gc_typed_calloc (struct custom_binary_port);
stream->read = read_proc;
@@ -734,7 +734,7 @@ make_bytevector_output_port (void)
{
SCM port, proc;
scm_t_bytevector_output_port_buffer *buf;
- const unsigned long mode_bits = SCM_OPN | SCM_WRTNG;
+ const unsigned long mode_bits = SCM_WRTNG;
buf = (scm_t_bytevector_output_port_buffer *)
scm_gc_malloc (sizeof (* buf), SCM_GC_BYTEVECTOR_OUTPUT_PORT);
@@ -868,7 +868,7 @@ make_custom_binary_output_port (SCM write_proc, SCM get_position_proc,
SCM set_position_proc, SCM close_proc)
{
struct custom_binary_port *stream;
- const unsigned long mode_bits = SCM_OPN | SCM_WRTNG;
+ const unsigned long mode_bits = SCM_WRTNG;
stream = scm_gc_typed_calloc (struct custom_binary_port);
stream->read = SCM_BOOL_F;
@@ -957,13 +957,8 @@ static scm_t_port_type *transcoded_port_type = 0;
static inline SCM
make_transcoded_port (SCM binary_port, unsigned long mode)
{
- SCM port;
- const unsigned long mode_bits = SCM_OPN | mode;
-
- port = scm_c_make_port (transcoded_port_type, mode_bits,
+ return scm_c_make_port (transcoded_port_type, mode,
SCM_UNPACK (binary_port));
-
- return port;
}
static size_t