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/ioext.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/ioext.c')
-rw-r--r-- | libguile/ioext.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libguile/ioext.c b/libguile/ioext.c index a65407f49..cdfed984a 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -102,12 +102,11 @@ without encountering a delimiter, this value is @var{#f}.") SCM_VALIDATE_OPINPORT (4,port); SCM_VALIDATE_INUM_DEF_COPY (5,start,0,cstart); - if (cstart < 0 || cstart >= cend) - scm_out_of_range (FUNC_NAME, start); + SCM_ASSERT_RANGE(5, start, cstart >= 0 && cstart < cend); SCM_VALIDATE_INUM_DEF_COPY (6,end,cend,tend); - if (tend <= cstart || tend > cend) - scm_out_of_range (FUNC_NAME, end); + SCM_ASSERT_RANGE(6, end, tend > cstart && tend <= cend); + cend = tend; for (j = cstart; j < cend; j++) @@ -397,8 +396,7 @@ SCM_DEFINE (scm_dup_to_fdes, "dup->fdes", 1, 1, 0, } else { - SCM_ASSERT (SCM_INUMP (fd), fd, SCM_ARG2, FUNC_NAME); - newfd = SCM_INUM (fd); + SCM_VALIDATE_INUM_COPY (2, fd, newfd); if (oldfd != newfd) { scm_evict_ports (newfd); /* see scsh manual. */ |