1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +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:
Andy Wingo 2016-06-18 13:08:12 +02:00
parent 8b87567085
commit 0c1ee6eae6

View file

@ -2307,12 +2307,14 @@ scm_end_input (SCM port)
{ {
SCM buf; SCM buf;
size_t discarded; size_t discarded;
scm_t_off offset;
buf = SCM_PORT (port)->read_buf; buf = SCM_PORT (port)->read_buf;
discarded = scm_port_buffer_take (buf, NULL, (size_t) -1); discarded = scm_port_buffer_take (buf, NULL, (size_t) -1);
offset = - (scm_t_off) discarded;
if (discarded != 0) if (offset != 0)
SCM_PORT_TYPE (port)->seek (port, -discarded, SEEK_CUR); SCM_PORT_TYPE (port)->seek (port, offset, SEEK_CUR);
} }
SCM_DEFINE (scm_force_output, "force-output", 0, 1, 0, SCM_DEFINE (scm_force_output, "force-output", 0, 1, 0,