1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 01:30:27 +02:00

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.
This commit is contained in:
Andy Wingo 2016-05-14 12:38:49 +02:00
parent 9322902d02
commit 9ecf77a82d
4 changed files with 16 additions and 33 deletions

View file

@ -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;
}