summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-05-13 13:04:49 +0200
committerAndy Wingo <wingo@pobox.com>2011-05-13 15:28:41 +0200
commit393baa8a4418ff404c6305fe84016fe3ed73da55 (patch)
tree19b01969365910d325510f436e689dfd5d0a1d7c
parentb2b33168b18c6c4fd65b0e77becba1a66a00dae1 (diff)
downloadguile-393baa8a4418ff404c6305fe84016fe3ed73da55.tar.gz
scm_is_false instead of == SCM_BOOL_F; also is_null, is_true, etc
* libguile/deprecation.c (scm_issue_deprecation_warning) * libguile/eval.c (CAPTURE_ENV): * libguile/goops.c (make_dispatch_procedure, make_class_from_symbol): (create_smob_classes): * libguile/guardians.c (finalize_guarded, scm_i_get_one_zombie): * libguile/hashtab.c (scm_fixup_weak_alist, scm_internal_hash_fold): * libguile/i18n.c (scm_nl_langinfo) * libguile/load.c (scm_primitive_load) * libguile/posix.c (scm_setrlimit) * libguile/socket.c (scm_to_sockaddr): * libguile/srcprop.c (scm_make_srcprops): Use scm_is_false / scm_is_true / scm_is_null instead of comparing against SCM_BOOL_F et al.
-rw-r--r--libguile/deprecation.c2
-rw-r--r--libguile/eval.c4
-rw-r--r--libguile/goops.c8
-rw-r--r--libguile/guardians.c8
-rw-r--r--libguile/hashtab.c4
-rw-r--r--libguile/i18n.c2
-rw-r--r--libguile/load.c2
-rw-r--r--libguile/posix.c4
-rw-r--r--libguile/socket.c4
-rw-r--r--libguile/srcprop.c6
10 files changed, 22 insertions, 22 deletions
diff --git a/libguile/deprecation.c b/libguile/deprecation.c
index 192667dde..be5fffc90 100644
--- a/libguile/deprecation.c
+++ b/libguile/deprecation.c
@@ -128,7 +128,7 @@ SCM_DEFINE(scm_issue_deprecation_warning,
char *c_msgs;
while (scm_is_pair (msgs))
{
- if (msgs_nl != SCM_EOL)
+ if (!scm_is_null (msgs_nl))
msgs_nl = scm_cons (nl, msgs_nl);
msgs_nl = scm_cons (SCM_CAR (msgs), msgs_nl);
msgs = SCM_CDR (msgs);
diff --git a/libguile/eval.c b/libguile/eval.c
index 0101f019e..e008b3a08 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -211,8 +211,8 @@ truncate_values (SCM x)
case, because further lexical contours should capture the current module.
*/
#define CAPTURE_ENV(env) \
- ((env == SCM_EOL) ? scm_current_module () : \
- ((env == SCM_BOOL_F) ? scm_the_root_module () : env))
+ (scm_is_null (env) ? scm_current_module () : \
+ (scm_is_false (env) ? scm_the_root_module () : env))
static SCM
eval (SCM x, SCM env)
diff --git a/libguile/goops.c b/libguile/goops.c
index 33933965c..899ba7329 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1702,7 +1702,7 @@ static SCM
make_dispatch_procedure (SCM gf)
{
static SCM var = SCM_BOOL_F;
- if (var == SCM_BOOL_F)
+ if (scm_is_false (var))
var = scm_module_variable (scm_c_resolve_module ("oop goops dispatch"),
sym_delayed_compile);
return scm_call_1 (SCM_VARIABLE_REF (var), gf);
@@ -2519,7 +2519,7 @@ static SCM
make_class_from_symbol (SCM type_name_sym, SCM supers, int applicablep)
{
SCM class, name;
- if (type_name_sym != SCM_BOOL_F)
+ if (scm_is_true (type_name_sym))
{
name = scm_string_append (scm_list_3 (scm_from_locale_string ("<"),
scm_symbol_to_string (type_name_sym),
@@ -2601,12 +2601,12 @@ create_smob_classes (void)
long i;
for (i = 0; i < SCM_I_MAX_SMOB_TYPE_COUNT; ++i)
- scm_smob_class[i] = 0;
+ scm_smob_class[i] = SCM_BOOL_F;
scm_smob_class[SCM_TC2SMOBNUM (scm_tc16_keyword)] = scm_class_keyword;
for (i = 0; i < scm_numsmob; ++i)
- if (!scm_smob_class[i])
+ if (scm_is_false (scm_smob_class[i]))
scm_smob_class[i] = scm_make_extended_class (SCM_SMOBNAME (i),
scm_smobs[i].apply != 0);
}
diff --git a/libguile/guardians.c b/libguile/guardians.c
index b11bf6430..81313df31 100644
--- a/libguile/guardians.c
+++ b/libguile/guardians.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2001, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001, 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
@@ -127,7 +127,7 @@ finalize_guarded (GC_PTR ptr, GC_PTR finalizer_data)
/* Tell each guardian interested in OBJ that OBJ is no longer
reachable. */
for (;
- guardian_list != SCM_EOL;
+ !scm_is_null (guardian_list);
guardian_list = SCM_CDR (guardian_list))
{
SCM zombies;
@@ -159,7 +159,7 @@ finalize_guarded (GC_PTR ptr, GC_PTR finalizer_data)
g->zombies = zombies;
}
- if (proxied_finalizer != SCM_BOOL_F)
+ if (scm_is_true (proxied_finalizer))
{
/* Re-register the finalizer that was in place before we installed this
one. */
@@ -257,7 +257,7 @@ scm_i_get_one_zombie (SCM guardian)
t_guardian *g = GUARDIAN_DATA (guardian);
SCM res = SCM_BOOL_F;
- if (g->zombies != SCM_EOL)
+ if (!scm_is_null (g->zombies))
{
/* Note: We return zombies in reverse order. */
res = SCM_CAR (g->zombies);
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index 37d168cf4..894fbf7d1 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -105,7 +105,7 @@ scm_fixup_weak_alist (SCM alist, size_t *removed_items)
{
/* Remove from ALIST weak pair PAIR whose car/cdr has been
nullified by the GC. */
- if (prev == SCM_EOL)
+ if (scm_is_null (prev))
result = SCM_CDR (alist);
else
SCM_SETCDR (prev, SCM_CDR (alist));
@@ -1396,7 +1396,7 @@ scm_internal_hash_fold (scm_t_hash_fold_fn fn, void *closure,
{
/* We hit a weak pair whose car/cdr has become
unreachable: unlink it from the bucket. */
- if (prev != SCM_BOOL_F)
+ if (scm_is_true (prev))
SCM_SETCDR (prev, SCM_CDR (ls));
else
SCM_SIMPLE_VECTOR_SET (buckets, i, SCM_CDR (ls));
diff --git a/libguile/i18n.c b/libguile/i18n.c
index 97ae4ef4c..cb6ab98ea 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -1591,7 +1591,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
if (*p == 0)
{
/* Cyclic grouping information. */
- if (last_pair != SCM_EOL)
+ if (!scm_is_null (last_pair))
SCM_SETCDR (last_pair, result);
}
}
diff --git a/libguile/load.c b/libguile/load.c
index b0137a11b..fa19a2a66 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -116,7 +116,7 @@ SCM_DEFINE (scm_primitive_load, "primitive-load", 1, 0, 0,
/* Lookup and use the current reader to read the next
expression. */
reader = scm_fluid_ref (the_reader);
- if (reader == SCM_BOOL_F)
+ if (scm_is_false (reader))
form = scm_read (port);
else
form = scm_call_1 (reader, port);
diff --git a/libguile/posix.c b/libguile/posix.c
index b2614c6a7..2923dc6f8 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -615,8 +615,8 @@ SCM_DEFINE (scm_setrlimit, "setrlimit", 3, 0, 0,
iresource = scm_to_resource (resource, FUNC_NAME, 1);
- lim.rlim_cur = (soft == SCM_BOOL_F) ? RLIM_INFINITY : scm_to_long (soft);
- lim.rlim_max = (hard == SCM_BOOL_F) ? RLIM_INFINITY : scm_to_long (hard);
+ lim.rlim_cur = scm_is_false (soft) ? RLIM_INFINITY : scm_to_long (soft);
+ lim.rlim_max = scm_is_false (hard) ? RLIM_INFINITY : scm_to_long (hard);
if (setrlimit (iresource, &lim) != 0)
scm_syserror (FUNC_NAME);
diff --git a/libguile/socket.c b/libguile/socket.c
index 10386b204..7d0049b1c 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1196,14 +1196,14 @@ scm_to_sockaddr (SCM address, size_t *address_size)
size_t path_len = 0;
path = SCM_SIMPLE_VECTOR_REF (address, 1);
- if ((!scm_is_string (path)) && (path != SCM_BOOL_F))
+ if (!scm_is_string (path) && !scm_is_false (path))
scm_misc_error (FUNC_NAME, "invalid unix address "
"path: ~A", scm_list_1 (path));
else
{
struct sockaddr_un c_unix;
- if (path == SCM_BOOL_F)
+ if (scm_is_false (path))
path_len = 0;
else
path_len = scm_c_string_length (path);
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index aee0b0985..4eb1ccaac 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -125,15 +125,15 @@ scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM alist)
thread safety.
*/
SCM last_acons = SCM_CDR (scm_last_alist_filename);
- if (old_alist == SCM_EOL
- && SCM_CDAR (last_acons) == filename)
+ if (scm_is_null (old_alist)
+ && scm_is_eq (SCM_CDAR (last_acons), filename))
{
alist = last_acons;
}
else
{
alist = scm_acons (scm_sym_filename, filename, alist);
- if (old_alist == SCM_EOL)
+ if (scm_is_null (old_alist))
SCM_SETCDR (scm_last_alist_filename, alist);
}
}