diff options
-rw-r--r-- | libguile/ChangeLog | 8 | ||||
-rw-r--r-- | libguile/list.c | 8 | ||||
-rw-r--r-- | libguile/unif.c | 4 | ||||
-rw-r--r-- | srfi/ChangeLog | 6 | ||||
-rw-r--r-- | srfi/srfi-1.c | 4 |
5 files changed, 22 insertions, 8 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ee0d68831..4e02b5c87 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,13 @@ 2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de> + * list.c (scm_ilength, scm_last_pair), unif.c (l2ra):Prefer + !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include + any calls to SCM_NCONSP any more. + + * unif.c (l2ra): Eliminate redundant check. + +2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de> + * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product, scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over SCM_NNULLP. Now, guile itself does not include any calls to diff --git a/libguile/list.c b/libguile/list.c index a081f097b..f1552c5e7 100644 --- a/libguile/list.c +++ b/libguile/list.c @@ -171,11 +171,11 @@ scm_ilength(SCM sx) do { if (SCM_NULL_OR_NIL_P(hare)) return i; - if (SCM_NCONSP(hare)) return -1; + if (!SCM_CONSP (hare)) return -1; hare = SCM_CDR(hare); i++; if (SCM_NULL_OR_NIL_P(hare)) return i; - if (SCM_NCONSP(hare)) return -1; + if (!SCM_CONSP (hare)) return -1; hare = SCM_CDR(hare); i++; /* For every two steps the hare takes, the tortoise takes one. */ @@ -292,10 +292,10 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0, SCM_VALIDATE_CONS (SCM_ARG1, lst); do { SCM ahead = SCM_CDR(hare); - if (SCM_NCONSP(ahead)) return hare; + if (!SCM_CONSP (ahead)) return hare; hare = ahead; ahead = SCM_CDR(hare); - if (SCM_NCONSP(ahead)) return hare; + if (!SCM_CONSP (ahead)) return hare; hare = ahead; tortoise = SCM_CDR(tortoise); } diff --git a/libguile/unif.c b/libguile/unif.c index 79e16a0b1..8b77b4a1e 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -2215,7 +2215,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k) { while (n--) { - if (SCM_IMP (lst) || SCM_NCONSP (lst)) + if (!SCM_CONSP (lst)) return 0; ok = ok && l2ra (SCM_CAR (lst), ra, base, k + 1); base += inc; @@ -2228,7 +2228,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k) { while (n--) { - if (SCM_IMP (lst) || SCM_NCONSP (lst)) + if (!SCM_CONSP (lst)) return 0; scm_array_set_x (SCM_ARRAY_V (ra), SCM_CAR (lst), SCM_MAKINUM (base)); base += inc; diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 847720384..45453da8d 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,9 @@ +2003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de> + + * srfi-1.c (srfi1_ilength): Prefer !SCM_CONSP over SCM_NCONSP. + Now, guile itself does not include any calls to SCM_NCONSP any + more. + 2003-04-05 Marius Vollmer <mvo@zagadka.de> * Changed license terms to the plain LGPL thru-out. diff --git a/srfi/srfi-1.c b/srfi/srfi-1.c index 84441543e..dc97102a0 100644 --- a/srfi/srfi-1.c +++ b/srfi/srfi-1.c @@ -38,11 +38,11 @@ srfi1_ilength (SCM sx) do { if (SCM_NULL_OR_NIL_P(hare)) return i; - if (SCM_NCONSP(hare)) return -2; + if (!SCM_CONSP (hare)) return -2; hare = SCM_CDR(hare); i++; if (SCM_NULL_OR_NIL_P(hare)) return i; - if (SCM_NCONSP(hare)) return -2; + if (!SCM_CONSP (hare)) return -2; hare = SCM_CDR(hare); i++; /* For every two steps the hare takes, the tortoise takes one. */ |