diff options
author | Andy Wingo <wingo@pobox.com> | 2011-10-24 17:22:47 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-10-24 17:22:47 +0200 |
commit | 62fdadb0a5f10ff34c7e19ac299aa89d950ffc69 (patch) | |
tree | 9a8758a238a05db05aa6a9090c30ade2fbe0c514 | |
parent | 8c0e89ac9093aee52620bbdbec07936532f05f3d (diff) |
check for pairs with scm_is_pair, not scm_nimp
* libguile/array-map.c (scm_ra_matchp, scm_ramapc):
* libguile/dynwind.c (scm_swap_bindings):
* libguile/hooks.c (hook_print, scm_c_run_hook, scm_c_run_hookn):
* libguile/objprop.c (scm_object_property, scm_set_object_property_x):
Use !scm_is_pair as the termination condition, not scm_imp.
-rw-r--r-- | libguile/array-map.c | 10 | ||||
-rw-r--r-- | libguile/dynwind.c | 2 | ||||
-rw-r--r-- | libguile/hooks.c | 8 | ||||
-rw-r--r-- | libguile/objprop.c | 4 | ||||
-rw-r--r-- | libguile/srcprop.c | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/libguile/array-map.c b/libguile/array-map.c index d442bdf4e..395fa11a0 100644 --- a/libguile/array-map.c +++ b/libguile/array-map.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,1998,2000,2001,2004,2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1996,1998,2000,2001,2004,2005, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -99,7 +99,7 @@ scm_ra_matchp (SCM ra0, SCM ras) else return 0; - while (SCM_NIMP (ras)) + while (scm_is_pair (ras)) { ra1 = SCM_CAR (ras); @@ -204,7 +204,7 @@ scm_ramapc (void *cproc_ptr, SCM data, SCM ra0, SCM lra, const char *what) } lvra = SCM_EOL; plvra = &lvra; - for (z = lra; SCM_NIMP (z); z = SCM_CDR (z)) + for (z = lra; scm_is_pair (z); z = SCM_CDR (z)) { ra1 = SCM_CAR (z); vra1 = scm_i_make_array (1); @@ -262,7 +262,7 @@ scm_ramapc (void *cproc_ptr, SCM data, SCM ra0, SCM lra, const char *what) } lvra = SCM_EOL; plvra = &lvra; - for (z = lra; SCM_NIMP (z); z = SCM_CDR (z)) + for (z = lra; scm_is_pair (z); z = SCM_CDR (z)) { ra1 = SCM_CAR (z); vra1 = scm_i_make_array (1); @@ -295,7 +295,7 @@ scm_ramapc (void *cproc_ptr, SCM data, SCM ra0, SCM lra, const char *what) { SCM y = lra; SCM_I_ARRAY_BASE (vra0) = cind (ra0, vinds); - for (z = lvra; SCM_NIMP (z); z = SCM_CDR (z), y = SCM_CDR (y)) + for (z = lvra; scm_is_pair (z); z = SCM_CDR (z), y = SCM_CDR (y)) SCM_I_ARRAY_BASE (SCM_CAR (z)) = cind (SCM_CAR (y), vinds); if (0 == (SCM_UNBNDP (data) ? cproc(vra0, lvra) : cproc(vra0, data, lvra))) return 0; diff --git a/libguile/dynwind.c b/libguile/dynwind.c index 14dd861dc..bec2dc806 100644 --- a/libguile/dynwind.c +++ b/libguile/dynwind.c @@ -195,7 +195,7 @@ void scm_swap_bindings (SCM vars, SCM vals) { SCM tmp; - while (SCM_NIMP (vals)) + while (scm_is_pair (vals)) { tmp = SCM_VARIABLE_REF (SCM_CAR (vars)); SCM_VARIABLE_SET (SCM_CAR (vars), SCM_CAR (vals)); diff --git a/libguile/hooks.c b/libguile/hooks.c index abba606f7..14335f879 100644 --- a/libguile/hooks.c +++ b/libguile/hooks.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2006, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -139,7 +139,7 @@ hook_print (SCM hook, SCM port, scm_print_state *pstate) scm_putc (' ', port); scm_uintprint (SCM_UNPACK (hook), 16, port); ls = SCM_HOOK_PROCEDURES (hook); - while (SCM_NIMP (ls)) + while (scm_is_pair (ls)) { scm_putc (' ', port); name = scm_procedure_name (SCM_CAR (ls)); @@ -269,7 +269,7 @@ void scm_c_run_hook (SCM hook, SCM args) { SCM procs = SCM_HOOK_PROCEDURES (hook); - while (SCM_NIMP (procs)) + while (scm_is_pair (procs)) { scm_apply_0 (SCM_CAR (procs), args); procs = SCM_CDR (procs); @@ -280,7 +280,7 @@ void scm_c_run_hookn (SCM hook, SCM *argv, size_t nargs) { SCM procs = SCM_HOOK_PROCEDURES (hook); - while (SCM_NIMP (procs)) + while (scm_is_pair (procs)) { scm_call_n (SCM_CAR (procs), argv, nargs); procs = SCM_CDR (procs); diff --git a/libguile/objprop.c b/libguile/objprop.c index 3a57d2866..b45c9aa26 100644 --- a/libguile/objprop.c +++ b/libguile/objprop.c @@ -64,7 +64,7 @@ SCM_DEFINE (scm_object_property, "object-property", 2, 0, 0, { SCM assoc; assoc = scm_assq (key, scm_object_properties (obj)); - return (SCM_NIMP (assoc) ? SCM_CDR (assoc) : SCM_BOOL_F); + return (scm_is_pair (assoc) ? SCM_CDR (assoc) : SCM_BOOL_F); } #undef FUNC_NAME @@ -80,7 +80,7 @@ SCM_DEFINE (scm_set_object_property_x, "set-object-property!", 3, 0, 0, scm_i_pthread_mutex_lock (&scm_i_misc_mutex); alist = scm_weak_table_refq (object_whash, obj, SCM_EOL); assoc = scm_assq (key, alist); - if (SCM_NIMP (assoc)) + if (scm_is_pair (assoc)) SCM_SETCDR (assoc, value); else scm_weak_table_putq_x (object_whash, obj, scm_acons (key, value, alist)); diff --git a/libguile/srcprop.c b/libguile/srcprop.c index cd16789c6..9f0749861 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -245,7 +245,7 @@ SCM_DEFINE (scm_source_property, "source-property", 2, 0, 0, p = SRCPROPALIST (p); alist: p = scm_assoc (key, p); - return (SCM_NIMP (p) ? SCM_CDR (p) : SCM_BOOL_F); + return (scm_is_pair (p) ? SCM_CDR (p) : SCM_BOOL_F); } return SCM_UNBNDP (p) ? SCM_BOOL_F : p; } |