summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg J. Badros <gjb@cs.washington.edu>2000-01-11 23:56:47 +0000
committerGreg J. Badros <gjb@cs.washington.edu>2000-01-11 23:56:47 +0000
commit5d2d2ffca7d7e160dc7e99cab690cf512fbcfb86 (patch)
tree72e53fcebe77e9073511921aea4599c02ef1b822
parent88423ab1abc7e901be9cf80989fa0bec9659dbc6 (diff)
downloadguile-5d2d2ffca7d7e160dc7e99cab690cf512fbcfb86.tar.gz
* dynl.c, feature.c, filesys.c, fports.c, list.c, load.c,
net_db.c, sort.c, stacks.c, unif.c: Use SCM_WTA, SCM_MISC_ERROR where possible. * symbols.c (scm_sysintern0): Fixed the function name in a scm_misc_error invocation. * print.c (scm_simple_format): Do not need SCM_COERCE_SUBSTR, and use scm_return_first to ward off latent GC bug that Mikael caught. * async.c: Use SCM_VALIDATE_ASYNC_COPY one place where it wasn't used before but should've been.
-rw-r--r--libguile/async.c7
-rw-r--r--libguile/dynl.c4
-rw-r--r--libguile/feature.c3
-rw-r--r--libguile/filesys.c10
-rw-r--r--libguile/fports.c5
-rw-r--r--libguile/list.c4
-rw-r--r--libguile/load.c3
-rw-r--r--libguile/net_db.c2
-rw-r--r--libguile/print.c3
-rw-r--r--libguile/sort.c6
-rw-r--r--libguile/stacks.c2
-rw-r--r--libguile/symbols.c2
-rw-r--r--libguile/unif.c6
13 files changed, 23 insertions, 34 deletions
diff --git a/libguile/async.c b/libguile/async.c
index aa3bb9ff9..6e59aa68a 100644
--- a/libguile/async.c
+++ b/libguile/async.c
@@ -348,8 +348,7 @@ SCM_DEFINE (scm_run_asyncs, "run-asyncs", 1, 0, 0,
struct scm_async * it;
SCM_VALIDATE_CONS (1,list_of_a);
a = SCM_CAR (list_of_a);
- SCM_ASSERT (SCM_ASYNCP (a), a, SCM_ARG1, FUNC_NAME);
- it = SCM_ASYNC (a);
+ SCM_VALIDATE_ASYNC_COPY (SCM_ARG1,a,it);
scm_mask_ints = 1;
if (it->got_it)
{
@@ -371,9 +370,7 @@ SCM_DEFINE (scm_noop, "noop", 0, 0, 1,
"")
#define FUNC_NAME s_scm_noop
{
- return (SCM_NULLP (args)
- ? SCM_BOOL_F
- : SCM_CAR (args));
+ return (SCM_NULLP (args) ? SCM_BOOL_F : SCM_CAR (args));
}
#undef FUNC_NAME
diff --git a/libguile/dynl.c b/libguile/dynl.c
index 102d9d621..d648d36ad 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -378,7 +378,7 @@ as the @var{lib} argument to the following functions.")
rest = SCM_CDR (rest);
if (!SCM_CONSP (rest))
- scm_misc_error (FUNC_NAME, "keyword without value", SCM_EOL);
+ SCM_MISC_ERROR ("keyword without value", SCM_EOL);
val = SCM_CAR (rest);
rest = SCM_CDR (rest);
@@ -389,7 +389,7 @@ as the @var{lib} argument to the following functions.")
flags &= ~DYNL_GLOBAL;
}
else
- scm_misc_error (FUNC_NAME, "unknown keyword argument: ~A",
+ SCM_MISC_ERROR ("unknown keyword argument: ~A",
scm_cons (kw, SCM_EOL));
}
diff --git a/libguile/feature.c b/libguile/feature.c
index c44abce8b..b1068aadd 100644
--- a/libguile/feature.c
+++ b/libguile/feature.c
@@ -280,8 +280,7 @@ SCM_DEFINE (scm_run_hook, "run-hook", 1, 0, 1,
if (SCM_UNBNDP (args))
args = SCM_EOL;
if (scm_ilength (args) != SCM_HOOK_ARITY (hook))
- scm_misc_error (FUNC_NAME,
- "Hook ~S requires ~A arguments",
+ SCM_MISC_ERROR ("Hook ~S requires ~A arguments",
SCM_LIST2 (hook,SCM_MAKINUM (SCM_HOOK_ARITY (hook))));
scm_c_run_hook (hook, args);
return SCM_UNSPECIFIED;
diff --git a/libguile/filesys.c b/libguile/filesys.c
index eb93ee507..3ffbd76d2 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -529,11 +529,10 @@ An integer representing the access permission bits.
{
int en = errno;
- scm_syserror_msg (FUNC_NAME, "~A: ~S",
+ SCM_SYSERROR_MSG ("~A: ~S",
scm_listify (scm_makfrom0str (strerror (errno)),
object,
- SCM_UNDEFINED),
- en);
+ SCM_UNDEFINED), en);
}
return scm_stat2scm (&stat_temp);
}
@@ -1179,11 +1178,10 @@ file it points to. @var{path} must be a string.")
{
int en = errno;
- scm_syserror_msg (FUNC_NAME, "~A: ~S",
+ SCM_SYSERROR_MSG ("~A: ~S",
scm_listify (scm_makfrom0str (strerror (errno)),
str,
- SCM_UNDEFINED),
- en);
+ SCM_UNDEFINED), en);
}
return scm_stat2scm(&stat_temp);
}
diff --git a/libguile/fports.c b/libguile/fports.c
index 8bf901d91..5a3ec73e8 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -354,10 +354,9 @@ If a file cannot be opened with the access requested,
{
int en = errno;
- scm_syserror_msg (FUNC_NAME, "~A: ~S",
+ SCM_SYSERROR_MSG ("~A: ~S",
scm_cons (scm_makfrom0str (strerror (en)),
- scm_cons (filename, SCM_EOL)),
- en);
+ scm_cons (filename, SCM_EOL)), en);
}
port = scm_fdes_to_port (fdes, mode, filename);
return port;
diff --git a/libguile/list.c b/libguile/list.c
index 531f1694d..c544352fa 100644
--- a/libguile/list.c
+++ b/libguile/list.c
@@ -255,7 +255,7 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
tortoise = SCM_CDR(tortoise);
}
while (hare != tortoise);
- scm_misc_error (FUNC_NAME, "Circular structure in position 1: ~S", SCM_LIST1 (lst));
+ SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
}
#undef FUNC_NAME
@@ -283,7 +283,7 @@ SCM_DEFINE (scm_reverse, "reverse", 1, 0, 0,
tortoise = SCM_CDR (tortoise);
}
while (hare != tortoise);
- scm_misc_error (FUNC_NAME, "Circular structure in position 1: ~S", SCM_LIST1 (lst));
+ SCM_MISC_ERROR ("Circular structure in position 1: ~S", SCM_LIST1 (lst));
}
#undef FUNC_NAME
diff --git a/libguile/load.c b/libguile/load.c
index daef405a8..316d1c940 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -440,8 +440,7 @@ the list of search paths, an error is signalled.")
{
int absolute = (SCM_ROLENGTH (filename) >= 1
&& SCM_ROCHARS (filename)[0] == '/');
- scm_misc_error (FUNC_NAME,
- (absolute
+ SCM_MISC_ERROR ((absolute
? "Unable to load file ~S"
: "Unable to find file ~S in load path"),
scm_listify (filename, SCM_UNDEFINED));
diff --git a/libguile/net_db.c b/libguile/net_db.c
index a4114fada..f8aab8528 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -360,7 +360,7 @@ given.")
entry = getnetbyaddr (netnum, AF_INET);
}
if (!entry)
- scm_syserror_msg (FUNC_NAME, "no such network ~A",
+ SCM_SYSERROR_MSG ("no such network ~A",
scm_listify (name, SCM_UNDEFINED), errno);
ve[0] = scm_makfromstr (entry->n_name, (scm_sizet) strlen (entry->n_name), 0);
ve[1] = scm_makfromstrs (-1, entry->n_aliases);
diff --git a/libguile/print.c b/libguile/print.c
index 4c3e87418..94d1ba5c4 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -967,7 +967,6 @@ Does not add a trailing newline.")
SCM_VALIDATE_STRING(2,message);
SCM_VALIDATE_LIST(3,args);
- SCM_COERCE_SUBSTR (message);
start = SCM_ROCHARS (message);
for (p = start; *p != '\0'; ++p)
if (*p == '~')
@@ -993,7 +992,7 @@ Does not add a trailing newline.")
if (fReturnString)
answer = scm_strport_to_string (destination);
- return answer;
+ return scm_return_first(answer,message);
}
#undef FUNC_NAME
diff --git a/libguile/sort.c b/libguile/sort.c
index da1f5bb0f..282a0083f 100644
--- a/libguile/sort.c
+++ b/libguile/sort.c
@@ -229,7 +229,7 @@ quicksort (void *const pbase,
left_ptr += size;
/* The comparison predicate may be buggy */
if (left_ptr > hi)
- scm_misc_error (0, s_buggy_less, SCM_EOL);
+ scm_misc_error (NULL, s_buggy_less, SCM_EOL);
}
while ((*cmp) (less, (void *) pivot, (void *) right_ptr))
@@ -237,7 +237,7 @@ quicksort (void *const pbase,
right_ptr -= size;
/* The comparison predicate may be buggy */
if (right_ptr < lo)
- scm_misc_error (0, s_buggy_less, SCM_EOL);
+ scm_misc_error (NULL, s_buggy_less, SCM_EOL);
}
if (left_ptr < right_ptr)
@@ -321,7 +321,7 @@ quicksort (void *const pbase,
tmp_ptr -= size;
/* The comparison predicate may be buggy */
if (tmp_ptr < base_ptr)
- scm_misc_error (0, s_buggy_less, SCM_EOL);
+ scm_misc_error (NULL, s_buggy_less, SCM_EOL);
}
tmp_ptr += size;
diff --git a/libguile/stacks.c b/libguile/stacks.c
index b5bd3cbbb..ce2e5f466 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -454,7 +454,7 @@ SCM_DEFINE (scm_make_stack, "make-stack", 0, 0, 1,
}
else
{
- scm_wta (obj, (char *) SCM_ARG1, FUNC_NAME);
+ SCM_WTA (SCM_ARG1, obj);
abort ();
}
}
diff --git a/libguile/symbols.c b/libguile/symbols.c
index c60deeeb7..f45b0ce5c 100644
--- a/libguile/symbols.c
+++ b/libguile/symbols.c
@@ -395,7 +395,7 @@ scm_sysintern0 (const char *name)
SCM sym = SCM_CAR (scm_intern0 (name));
SCM vcell = scm_sym2vcell (sym, lookup_proc, SCM_BOOL_T);
if (vcell == SCM_BOOL_F)
- scm_misc_error ("sysintern", "can't define variable", sym);
+ scm_misc_error ("sysintern0", "can't define variable", sym);
return vcell;
}
else
diff --git a/libguile/unif.c b/libguile/unif.c
index 3789c7280..85325d408 100644
--- a/libguile/unif.c
+++ b/libguile/unif.c
@@ -1487,7 +1487,7 @@ loop:
switch SCM_TYP7 (v)
{
default:
- badarg1:scm_wta (v, (char *) SCM_ARG1, FUNC_NAME);
+ badarg1:SCM_WTA (SCM_ARG1,v);
case scm_tc7_smob:
SCM_ASRTGO (SCM_ARRAYP (v), badarg1);
cra = scm_ra2contig (ra, 0);
@@ -1578,9 +1578,7 @@ loop:
{
if (remaining % sz != 0)
{
- scm_misc_error (FUNC_NAME,
- "unexpected EOF",
- SCM_EOL);
+ SCM_MISC_ERROR ("unexpected EOF", SCM_EOL);
}
ans -= remaining / sz;
break;