summaryrefslogtreecommitdiff
path: root/libguile/weaks.c
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@lilypond.org>2002-07-20 14:08:34 +0000
committerHan-Wen Nienhuys <hanwen@lilypond.org>2002-07-20 14:08:34 +0000
commit34d19ef64368a8bac8a32f799b71dc05dd587654 (patch)
treebdf482155a8d561207b1a9c780f98ca666b77317 /libguile/weaks.c
parentdd897aafbd218685874256405f740a0e9e1e7303 (diff)
downloadguile-34d19ef64368a8bac8a32f799b71dc05dd587654.tar.gz
2002-07-20 Han-Wen <hanwen@cs.uu.nl>
* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found.
Diffstat (limited to 'libguile/weaks.c')
-rw-r--r--libguile/weaks.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libguile/weaks.c b/libguile/weaks.c
index 535b4482e..90b573185 100644
--- a/libguile/weaks.c
+++ b/libguile/weaks.c
@@ -141,8 +141,11 @@ SCM_DEFINE (scm_weak_vector, "weak-vector", 0, 0, 1,
i = scm_ilength (l);
SCM_ASSERT (i >= 0, l, SCM_ARG1, FUNC_NAME);
res = scm_make_weak_vector (SCM_MAKINUM (i), SCM_UNSPECIFIED);
- data = SCM_VELTS (res);
+ /*
+ no alloc, so this loop is safe.
+ */
+ data = SCM_WRITABLE_VELTS (res);
while (!SCM_NULL_OR_NIL_P (l))
{
*data++ = SCM_CAR (l);
@@ -261,7 +264,7 @@ scm_mark_weak_vector_spines (void *dummy1 SCM_UNUSED,
{
if (SCM_IS_WHVEC_ANY (w))
{
- SCM *ptr;
+ SCM const *ptr;
SCM obj;
long j;
long n;
@@ -302,7 +305,7 @@ scm_scan_weak_vectors (void *dummy1 SCM_UNUSED,
{
register long j, n;
- ptr = SCM_VELTS (w);
+ ptr = SCM_GC_WRITABLE_VELTS (w);
n = SCM_VECTOR_LENGTH (w);
for (j = 0; j < n; ++j)
if (SCM_FREE_CELL_P (ptr[j]))
@@ -316,7 +319,7 @@ scm_scan_weak_vectors (void *dummy1 SCM_UNUSED,
int weak_keys = SCM_IS_WHVEC (obj) || SCM_IS_WHVEC_B (obj);
int weak_values = SCM_IS_WHVEC_V (obj) || SCM_IS_WHVEC_B (obj);
- ptr = SCM_VELTS (w);
+ ptr = SCM_GC_WRITABLE_VELTS (w);
for (j = 0; j < n; ++j)
{