mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 02:00:26 +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:
parent
9322902d02
commit
9ecf77a82d
4 changed files with 16 additions and 33 deletions
|
@ -485,9 +485,8 @@ scm_c_make_port_buffer (size_t size)
|
|||
static long
|
||||
scm_i_mode_bits_n (SCM modes)
|
||||
{
|
||||
return (SCM_OPN
|
||||
| (scm_i_string_contains_char (modes, 'r')
|
||||
|| scm_i_string_contains_char (modes, '+') ? SCM_RDNG : 0)
|
||||
return ((scm_i_string_contains_char (modes, 'r')
|
||||
|| scm_i_string_contains_char (modes, '+') ? SCM_RDNG : 0)
|
||||
| (scm_i_string_contains_char (modes, 'w')
|
||||
|| scm_i_string_contains_char (modes, 'a')
|
||||
|| scm_i_string_contains_char (modes, '+') ? SCM_WRTNG : 0)
|
||||
|
@ -629,7 +628,7 @@ scm_c_make_port_with_encoding (scm_t_port_type *ptob, unsigned long mode_bits,
|
|||
|
||||
pt = scm_gc_typed_calloc (scm_t_port);
|
||||
|
||||
ret = scm_words (scm_tc7_port | mode_bits, 4);
|
||||
ret = scm_words (scm_tc7_port | mode_bits | SCM_OPN, 4);
|
||||
SCM_SET_CELL_WORD_1 (ret, stream);
|
||||
SCM_SET_CELL_WORD_2 (ret, (scm_t_bits) pt);
|
||||
SCM_SET_CELL_WORD_3 (ret, (scm_t_bits) ptob);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue