[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 11/15: Remove scm_fill_input_unlocked
From: |
Andy Wingo |
Subject: |
[Guile-commits] 11/15: Remove scm_fill_input_unlocked |
Date: |
Tue, 26 Apr 2016 21:38:55 +0000 |
wingo pushed a commit to branch wip-port-refactor
in repository guile.
commit 796676028b5812b556decf5cad1f3ce3992ac25f
Author: Andy Wingo <address@hidden>
Date: Tue Apr 26 22:13:26 2016 +0200
Remove scm_fill_input_unlocked
* libguile/ports.h (scm_fill_input_unlocked): Remove.
* libguile/ports.c (scm_fill_input): Rename from
scm_fill_input_unlocked. Adapt callers.
* libguile/r6rs-ports.c (scm_get_bytevector_some): Adapt.
* libguile/read.c (scm_i_scan_for_encoding): Adapt.
---
libguile/ports.c | 20 ++------------------
libguile/ports.h | 1 -
libguile/r6rs-ports.c | 2 +-
libguile/read.c | 2 +-
4 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/libguile/ports.c b/libguile/ports.c
index 2062f58..58fe0f7 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -1516,7 +1516,7 @@ scm_c_read_bytes (SCM port, SCM dst, size_t start, size_t
count)
buffer directly. */
if (to_read < pt->read_buffering)
{
- read_buf = scm_fill_input_unlocked (port);
+ read_buf = scm_fill_input (port);
did_read = scm_port_buffer_take (read_buf, dst_ptr, to_read);
dst_ptr += did_read;
to_read -= did_read;
@@ -2310,20 +2310,6 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1, 0,
}
#undef FUNC_NAME
-SCM
-scm_fill_input (SCM port)
-{
- scm_i_pthread_mutex_t *lock;
- SCM ret;
-
- scm_c_lock_port (port, &lock);
- ret = scm_fill_input_unlocked (port);
- if (lock)
- scm_i_pthread_mutex_unlock (lock);
-
- return ret;
-}
-
/* Move up to READ_LEN bytes from PORT's read buffer into memory
starting at DEST. Return the number of bytes moved. PORT's
line/column numbers are left unchanged. */
@@ -2378,11 +2364,9 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0,
void
scm_end_input (SCM port)
{
- scm_t_port *pt;
SCM buf;
size_t discarded;
- pt = SCM_PTAB_ENTRY (port);
buf = SCM_PTAB_ENTRY (port)->read_buf;
discarded = scm_port_buffer_take (buf, NULL, (size_t) -1);
@@ -2423,7 +2407,7 @@ scm_flush (SCM port)
}
SCM
-scm_fill_input_unlocked (SCM port)
+scm_fill_input (SCM port)
{
scm_t_port *pt = SCM_PTAB_ENTRY (port);
SCM read_buf = pt->read_buf;
diff --git a/libguile/ports.h b/libguile/ports.h
index 82b2553..4ea2c30 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -314,7 +314,6 @@ SCM_API SCM scm_unread_string (SCM str, SCM port);
/* Manipulating the buffers. */
SCM_API SCM scm_setvbuf (SCM port, SCM mode, SCM size);
SCM_API SCM scm_fill_input (SCM port);
-SCM_API SCM scm_fill_input_unlocked (SCM port);
SCM_INTERNAL size_t scm_take_from_input_buffers (SCM port, char *dest, size_t
read_len);
SCM_API SCM scm_drain_input (SCM port);
SCM_API void scm_end_input (SCM port);
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index db95e08..bad344f 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -474,7 +474,7 @@ SCM_DEFINE (scm_get_bytevector_some, "get-bytevector-some",
1, 0, 0,
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
- buf = scm_fill_input_unlocked (port);
+ buf = scm_fill_input (port);
size = scm_port_buffer_can_take (buf);
if (size == 0)
{
diff --git a/libguile/read.c b/libguile/read.c
index bcbf37e..ca9694f 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -2073,7 +2073,7 @@ scm_i_scan_for_encoding (SCM port)
if (scm_port_buffer_can_take (buf) == 0)
{
/* We can use the read buffer, and thus avoid a seek. */
- buf = scm_fill_input_unlocked (port);
+ buf = scm_fill_input (port);
bytes_read = scm_port_buffer_can_take (buf);
if (bytes_read > SCM_ENCODING_SEARCH_SIZE)
bytes_read = SCM_ENCODING_SEARCH_SIZE;
- [Guile-commits] branch wip-port-refactor updated (5a342f6 -> 15d5304), Andy Wingo, 2016/04/26
- [Guile-commits] 01/15: Refactor thread safety for %port-property, Andy Wingo, 2016/04/26
- [Guile-commits] 03/15: scm_c_read instead of scm_c_read_unlock, Andy Wingo, 2016/04/26
- [Guile-commits] 02/15: Refactor to internal get/peek-byte functions, Andy Wingo, 2016/04/26
- [Guile-commits] 04/15: Remove port rw_active field, Andy Wingo, 2016/04/26
- [Guile-commits] 08/15: Remove scm_unget_{byte,bytes}_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 06/15: Remove scm_c_read_bytes_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 10/15: Remove locking in scm_end_input, Andy Wingo, 2016/04/26
- [Guile-commits] 05/15: Remove scm_flush_unlocked / scm_end_input_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 11/15: Remove scm_fill_input_unlocked,
Andy Wingo <=
- [Guile-commits] 09/15: scm_ungetc, scm_ungets instead of _unlocked variants, Andy Wingo, 2016/04/26
- [Guile-commits] 07/15: Replace scm_getc with scm_getc_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 14/15: Remove scm_c_write_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 15/15: scm_lfwrite, not scm_lfwrite_unlocked, Andy Wingo, 2016/04/26
- [Guile-commits] 12/15: Remove scm_putc_unlocked., Andy Wingo, 2016/04/26
- [Guile-commits] 13/15: Remove scm_puts_unlocked., Andy Wingo, 2016/04/26