1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-23 04:50:28 +02:00

get-bytevector-n and get-bytevector-n! can now read more than 4 GB

* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x):
Turn 'c_count' and related variables into a 'size_t', and use
'scm_to_size_t' instead of 'scm_to_uint'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Jan Smydke 2018-05-19 12:48:01 +02:00 committed by Ludovic Courtès
parent efc33cd149
commit 26b446d52b

View file

@ -408,11 +408,11 @@ SCM_DEFINE (scm_get_bytevector_n, "get-bytevector-n", 2, 0, 0,
#define FUNC_NAME s_scm_get_bytevector_n
{
SCM result;
unsigned c_count;
size_t c_count;
size_t c_read;
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
c_count = scm_to_uint (count);
c_count = scm_to_size_t (count);
result = scm_c_make_bytevector (c_count);
@ -444,13 +444,13 @@ SCM_DEFINE (scm_get_bytevector_n_x, "get-bytevector-n!", 4, 0, 0,
#define FUNC_NAME s_scm_get_bytevector_n_x
{
SCM result;
unsigned c_start, c_count, c_len;
size_t c_start, c_count, c_len;
size_t c_read;
SCM_VALIDATE_BINARY_INPUT_PORT (1, port);
SCM_VALIDATE_BYTEVECTOR (2, bv);
c_start = scm_to_uint (start);
c_count = scm_to_uint (count);
c_start = scm_to_size_t (start);
c_count = scm_to_size_t (count);
c_len = SCM_BYTEVECTOR_LENGTH (bv);