diff options
author | Greg J. Badros <gjb@cs.washington.edu> | 2000-01-12 01:51:18 +0000 |
---|---|---|
committer | Greg J. Badros <gjb@cs.washington.edu> | 2000-01-12 01:51:18 +0000 |
commit | c1bfcf602b80bca6c6ccec0a100ec59258c4160d (patch) | |
tree | d94171f20b886a35e02b324407af13d27d3957b5 /libguile/filesys.c | |
parent | d61f6b028874eee1656d3b4211189fcb80cb8ec0 (diff) | |
download | guile-c1bfcf602b80bca6c6ccec0a100ec59258c4160d.tar.gz |
* scm_validate.h: Added SCM_NUM2LONG_DEF macro. Make
SCM_OUT_OF_RANGE use SCM_MAKINUM, not scm_long2num. Added
SCM_COERCE_ROSTRING macro. Added SCM_VALIDATE_NONEMPTYLIST
macro. Fix SCM_VALIDATE_STRINGORSUBSTR macro to not use SLOPPY
variants.
* ports.c (scm_port_closed_p): Validate that the arg is a PORT,
then return whether it's an open port (was validating that it was
an open port -- this was a bug I introduced back in December, but
my careful reading of diffs caught it).
* numbers.c: Recombine the two conditional-compilation paths for
all the log* primitives -- they were split based on #ifndef
scm_long2num; factored out a SCM_LOGOP_RETURN macro, and fixed
some bugs and inconsistencies in the two sets of implementations.
(scm_lognot) Fixed *atrocious* re-use of a SCM as an integer!
* ioext.c: Use SCM_ASSERT_RANGE in a couple places, and
SCM_VALIDATE_INUM_COPY once where it should've been used.
* fluids.c (scm_internal_with_fluids): Use
SCM_VALIDATE_LIST_COPYLEN.
* filesys.c: Use SCM_NUM2LONG instead of SCM_VALIDATE_INUM_COPY;
this is questionable as it relaxes type safety, but other changes
were useful and all SCM_NUM2LONG's should probably be
revisited. Use SCM_OUT_OF_RANGE, SCM_WRONG_TYPE_ARG.
* evalext.c: line-break change on 1 line.
* eval.c (nconc2last): Takes a non-empty list as its first
argument, not just a list.
* dynl.c: Use new SCM_COERCE_ROSTRING macro.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index 3ffbd76d2..848138ec7 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -155,8 +155,7 @@ as @code{-1}, then that ID is not changed.") } else { - SCM_ASSERT (SCM_ROSTRINGP (object), - object, SCM_ARG1, FUNC_NAME); + SCM_VALIDATE_ROSTRING(1,object); SCM_COERCE_SUBSTR (object); SCM_SYSCALL (rv = chown (SCM_ROCHARS (object), SCM_INUM (owner), SCM_INUM (group))); @@ -243,8 +242,8 @@ port.") SCM_VALIDATE_ROSTRING (1,path); SCM_COERCE_SUBSTR (path); - SCM_VALIDATE_INUM_COPY (2,flags,iflags); - SCM_VALIDATE_INUM_DEF_COPY (3,mode,0666,imode); + iflags = SCM_NUM2LONG(2,flags); + imode = SCM_NUM2LONG_DEF(3,mode,0666); SCM_SYSCALL (fd = open (SCM_ROCHARS (path), iflags, imode)); if (fd == -1) SCM_SYSERROR; @@ -289,7 +288,7 @@ for additional flags.") int iflags; fd = SCM_INUM (scm_open_fdes (path, flags, mode)); - SCM_VALIDATE_INUM_COPY (2,flags,iflags); + iflags = SCM_NUM2LONG (2,flags); if (iflags & O_RDWR) { if (iflags & O_APPEND) @@ -520,7 +519,7 @@ An integer representing the access permission bits. else { object = SCM_COERCE_OUTPORT (object); - SCM_ASSERT (SCM_OPFPORTP (object), object, SCM_ARG1, FUNC_NAME); + SCM_VALIDATE_OPFPORT(1,object); fdes = SCM_FPORT_FDES (object); SCM_SYSCALL (rv = fstat (fdes, &stat_temp)); } @@ -996,9 +995,9 @@ values instead of a list and has an additional select! interface. double fl = scm_num2dbl (secs, FUNC_NAME); if (!SCM_UNBNDP (usecs)) - scm_wrong_type_arg (FUNC_NAME, 4, secs); + SCM_WRONG_TYPE_ARG (4, secs); if (fl > LONG_MAX) - scm_out_of_range (FUNC_NAME, secs); + SCM_OUT_OF_RANGE (4, secs); timeout.tv_sec = (long) fl; timeout.tv_usec = (long) ((fl - timeout.tv_sec) * 1000000); } |