summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-11-28 15:11:31 +0100
committerLudovic Courtès <ludo@gnu.org>2009-11-28 15:11:31 +0100
commit5c8cefe591d465af8d8eee9ca6edb98143107a73 (patch)
treee29bf20aa3ed79f64325ef39197468152f062318
parent49bb5bd30714af627ae78b0897ab05ba566e7c00 (diff)
downloadguile-5c8cefe591d465af8d8eee9ca6edb98143107a73.tar.gz
Remove remaining uses of discouraged constructs.
* libguile/frames.c, libguile/instructions.c, libguile/objcodes.c, libguile/programs.c, libguile/throw.c, libguile/vm-i-scheme.c, libguile/vm.c: Replace uses of discouraged constructs by their current counterparts.
-rw-r--r--libguile/frames.c2
-rw-r--r--libguile/instructions.c16
-rw-r--r--libguile/objcodes.c2
-rw-r--r--libguile/programs.c6
-rw-r--r--libguile/throw.c4
-rw-r--r--libguile/vm-i-scheme.c10
-rw-r--r--libguile/vm.c2
7 files changed, 22 insertions, 20 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index 39f78e09a..c0d7d61e4 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -66,7 +66,7 @@ SCM_DEFINE (scm_vm_frame_p, "vm-frame?", 1, 0, 0,
"")
#define FUNC_NAME s_scm_vm_frame_p
{
- return SCM_BOOL (SCM_VM_FRAME_P (obj));
+ return scm_from_bool (SCM_VM_FRAME_P (obj));
}
#undef FUNC_NAME
diff --git a/libguile/instructions.c b/libguile/instructions.c
index 04180e5e3..c870b319b 100644
--- a/libguile/instructions.c
+++ b/libguile/instructions.c
@@ -83,17 +83,19 @@ scm_lookup_instruction_by_name (SCM name)
struct scm_instruction *table = fetch_instruction_table ();
SCM op;
- if (SCM_UNLIKELY (SCM_FALSEP (instructions_by_name)))
- {
- int i;
- instructions_by_name = scm_permanent_object
- (scm_make_hash_table (SCM_I_MAKINUM (SCM_VM_NUM_INSTRUCTIONS)));
+ if (SCM_UNLIKELY (scm_is_false (instructions_by_name)))
+ {
+ unsigned int i;
+
+ instructions_by_name =
+ scm_make_hash_table (SCM_I_MAKINUM (SCM_VM_NUM_INSTRUCTIONS));
+
for (i = 0; i < SCM_VM_NUM_INSTRUCTIONS; i++)
if (scm_is_true (table[i].symname))
scm_hashq_set_x (instructions_by_name, table[i].symname,
SCM_I_MAKINUM (i));
}
-
+
op = scm_hashq_ref (instructions_by_name, name, SCM_UNDEFINED);
if (SCM_I_INUMP (op))
return &table[SCM_I_INUM (op)];
@@ -124,7 +126,7 @@ SCM_DEFINE (scm_instruction_p, "instruction?", 1, 0, 0,
"")
#define FUNC_NAME s_scm_instruction_p
{
- return SCM_BOOL (scm_lookup_instruction_by_name (obj));
+ return scm_from_bool (scm_lookup_instruction_by_name (obj) != NULL);
}
#undef FUNC_NAME
diff --git a/libguile/objcodes.c b/libguile/objcodes.c
index de3a308e5..1b896df42 100644
--- a/libguile/objcodes.c
+++ b/libguile/objcodes.c
@@ -145,7 +145,7 @@ SCM_DEFINE (scm_objcode_p, "objcode?", 1, 0, 0,
"")
#define FUNC_NAME s_scm_objcode_p
{
- return SCM_BOOL (SCM_OBJCODE_P (obj));
+ return scm_from_bool (SCM_OBJCODE_P (obj));
}
#undef FUNC_NAME
diff --git a/libguile/programs.c b/libguile/programs.c
index 646443af6..7736ea5e6 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -58,12 +58,12 @@ scm_i_program_print (SCM program, SCM port, scm_print_state *pstate)
{
static int print_error = 0;
- if (SCM_FALSEP (write_program) && scm_module_system_booted_p)
+ if (scm_is_false (write_program) && scm_module_system_booted_p)
write_program = scm_module_local_variable
(scm_c_resolve_module ("system vm program"),
scm_from_locale_symbol ("write-program"));
- if (SCM_FALSEP (write_program) || print_error)
+ if (scm_is_false (write_program) || print_error)
{
scm_puts ("#<program ", port);
scm_uintprint (SCM_CELL_WORD_1 (program), 16, port);
@@ -87,7 +87,7 @@ SCM_DEFINE (scm_program_p, "program?", 1, 0, 0,
"")
#define FUNC_NAME s_scm_program_p
{
- return SCM_BOOL (SCM_PROGRAM_P (obj));
+ return scm_from_bool (SCM_PROGRAM_P (obj));
}
#undef FUNC_NAME
diff --git a/libguile/throw.c b/libguile/throw.c
index 07d215f41..2217c95ea 100644
--- a/libguile/throw.c
+++ b/libguile/throw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008, 2009 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
@@ -177,7 +177,7 @@ scm_c_catch (SCM tag,
struct pre_unwind_data pre_unwind;
vm = scm_the_vm ();
- if (SCM_NFALSEP (vm))
+ if (scm_is_true (vm))
{
sp = SCM_VM_DATA (vm)->sp;
fp = SCM_VM_DATA (vm)->fp;
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index 52f5b113f..c9b40ee56 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -44,13 +44,13 @@ VM_DEFINE_FUNCTION (101, not_not, "not-not", 1)
VM_DEFINE_FUNCTION (102, eq, "eq?", 2)
{
ARGS2 (x, y);
- RETURN (scm_from_bool (SCM_EQ_P (x, y)));
+ RETURN (scm_from_bool (scm_is_eq (x, y)));
}
VM_DEFINE_FUNCTION (103, not_eq, "not-eq?", 2)
{
ARGS2 (x, y);
- RETURN (scm_from_bool (!SCM_EQ_P (x, y)));
+ RETURN (scm_from_bool (!scm_is_eq (x, y)));
}
VM_DEFINE_FUNCTION (104, nullp, "null?", 1)
@@ -68,7 +68,7 @@ VM_DEFINE_FUNCTION (105, not_nullp, "not-null?", 1)
VM_DEFINE_FUNCTION (106, eqv, "eqv?", 2)
{
ARGS2 (x, y);
- if (SCM_EQ_P (x, y))
+ if (scm_is_eq (x, y))
RETURN (SCM_BOOL_T);
if (SCM_IMP (x) || SCM_IMP (y))
RETURN (SCM_BOOL_F);
@@ -79,7 +79,7 @@ VM_DEFINE_FUNCTION (106, eqv, "eqv?", 2)
VM_DEFINE_FUNCTION (107, equal, "equal?", 2)
{
ARGS2 (x, y);
- if (SCM_EQ_P (x, y))
+ if (scm_is_eq (x, y))
RETURN (SCM_BOOL_T);
if (SCM_IMP (x) || SCM_IMP (y))
RETURN (SCM_BOOL_F);
@@ -90,7 +90,7 @@ VM_DEFINE_FUNCTION (107, equal, "equal?", 2)
VM_DEFINE_FUNCTION (108, pairp, "pair?", 1)
{
ARGS1 (x);
- RETURN (scm_from_bool (SCM_CONSP (x)));
+ RETURN (scm_from_bool (scm_is_pair (x)));
}
VM_DEFINE_FUNCTION (109, listp, "list?", 1)
diff --git a/libguile/vm.c b/libguile/vm.c
index 2262aa280..209408b33 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -254,7 +254,7 @@ resolve_variable (SCM what, SCM program_module)
mod = scm_resolve_module (SCM_CAR (what));
if (scm_is_true (SCM_CADDR (what)))
mod = scm_module_public_interface (mod);
- if (SCM_FALSEP (mod))
+ if (scm_is_false (mod))
scm_misc_error (NULL, "no such module: ~S",
scm_list_1 (SCM_CAR (what)));
/* might longjmp */