diff --git a/libguile/ChangeLog b/libguile/ChangeLog index fd3063050..0741cc845 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -2,6 +2,13 @@ Mon Dec 9 10:10:38 1996 Tom Tromey * inet_aton.c: Use #if 0, not #ifdef 0. +Mon Dec 9 06:36:48 1996 Gary Houston + + * ioext.c (scm_sys_ftell): use scm_long2num instead of SCM_MAKINUM + to convert the returned value. + (scm_sys_fseek): use scm_num2long instead of SCM_INUM to convert + the offset argument. + Sun Dec 8 21:06:38 1996 Jim Blandy Add new interface to catch/throw, usable from C as well as diff --git a/libguile/ioext.c b/libguile/ioext.c index 0cc53ecc7..37b8bdc34 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -69,7 +69,7 @@ scm_sys_ftell (port) scm_syserror (s_sys_ftell); if (pos > 0 && SCM_CRDYP (port)) pos--; - return SCM_MAKINUM (pos); + return scm_long2num (pos); } @@ -83,13 +83,16 @@ scm_sys_fseek (port, offset, whence) SCM whence; { int rv; + long loff; + SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_fseek); - SCM_ASSERT (SCM_INUMP (offset), offset, SCM_ARG2, s_sys_fseek); + loff = scm_num2long (offset, (char *)SCM_ARG2, s_sys_fseek); SCM_ASSERT (SCM_INUMP (whence) && (SCM_INUM (whence) < 3) && (SCM_INUM (whence) >= 0), whence, SCM_ARG3, s_sys_fseek); + SCM_CLRDY (port); /* Clear ungetted char */ /* Values of whence are interned in scm_init_ioext. */ - rv = fseek ((FILE *)SCM_STREAM (port), SCM_INUM (offset), SCM_INUM (whence)); + rv = fseek ((FILE *)SCM_STREAM (port), loff, SCM_INUM (whence)); if (rv != 0) scm_syserror (s_sys_fseek); return SCM_UNSPECIFIED;