summaryrefslogtreecommitdiff
path: root/libguile/strports.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/strports.c
parent9322902d02ecc23ec4c8534dbbc03c3074b78217 (diff)
downloadguile-9ecf77a82d6060a26f6891181f4582cc19dec65e.tar.gz
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/strports.c')
-rw-r--r--libguile/strports.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/libguile/strports.c b/libguile/strports.c
index 1a893ac34..e2bbe53ca 100644
--- a/libguile/strports.c
+++ b/libguile/strports.c
@@ -215,8 +215,7 @@ SCM_DEFINE (scm_object_to_string, "object->string", 1, 1, 0,
if (!SCM_UNBNDP (printer))
SCM_VALIDATE_PROC (2, printer);
- port = scm_mkstrport (SCM_INUM0, SCM_BOOL_F,
- SCM_OPN | SCM_WRTNG, FUNC_NAME);
+ port = scm_mkstrport (SCM_INUM0, SCM_BOOL_F, SCM_WRTNG, FUNC_NAME);
if (SCM_UNBNDP (printer))
scm_write (obj, port);
@@ -267,8 +266,7 @@ SCM_DEFINE (scm_open_input_string, "open-input-string", 1, 0, 0,
"by the garbage collector if it becomes inaccessible.")
#define FUNC_NAME s_scm_open_input_string
{
- SCM p = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, FUNC_NAME);
- return p;
+ return scm_mkstrport (SCM_INUM0, str, SCM_RDNG, FUNC_NAME);
}
#undef FUNC_NAME
@@ -281,12 +279,7 @@ SCM_DEFINE (scm_open_output_string, "open-output-string", 0, 0, 0,
"inaccessible.")
#define FUNC_NAME s_scm_open_output_string
{
- SCM p;
-
- p = scm_mkstrport (SCM_INUM0, SCM_BOOL_F,
- SCM_OPN | SCM_WRTNG,
- FUNC_NAME);
- return p;
+ return scm_mkstrport (SCM_INUM0, SCM_BOOL_F, SCM_WRTNG, FUNC_NAME);
}
#undef FUNC_NAME
@@ -308,15 +301,13 @@ SCM_DEFINE (scm_get_output_string, "get-output-string", 1, 0, 0,
SCM
scm_c_read_string (const char *expr)
{
- SCM port = scm_mkstrport (SCM_INUM0,
- scm_from_locale_string (expr),
- SCM_OPN | SCM_RDNG,
- "scm_c_read_string");
- SCM form;
+ SCM port, form;
+ port = scm_mkstrport (SCM_INUM0, scm_from_locale_string (expr),
+ SCM_RDNG, "scm_c_read_string");
form = scm_read (port);
-
scm_close_port (port);
+
return form;
}