mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Fix ports bug when size_t is 32 bits
* libguile/ports.c (scm_end_input): I am a complete idiot. I had no idea that `- (uint32_t) x' is actually still a uint32_t.
This commit is contained in:
parent
8b87567085
commit
0c1ee6eae6
1 changed files with 4 additions and 2 deletions
|
@ -2307,12 +2307,14 @@ scm_end_input (SCM port)
|
|||
{
|
||||
SCM buf;
|
||||
size_t discarded;
|
||||
scm_t_off offset;
|
||||
|
||||
buf = SCM_PORT (port)->read_buf;
|
||||
discarded = scm_port_buffer_take (buf, NULL, (size_t) -1);
|
||||
offset = - (scm_t_off) discarded;
|
||||
|
||||
if (discarded != 0)
|
||||
SCM_PORT_TYPE (port)->seek (port, -discarded, SEEK_CUR);
|
||||
if (offset != 0)
|
||||
SCM_PORT_TYPE (port)->seek (port, offset, SEEK_CUR);
|
||||
}
|
||||
|
||||
SCM_DEFINE (scm_force_output, "force-output", 0, 1, 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue