From 34d19ef64368a8bac8a32f799b71dc05dd587654 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 20 Jul 2002 14:08:34 +0000 Subject: 2002-07-20 Han-Wen * *.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. --- libguile/weaks.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libguile/weaks.c') 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) { -- cgit v1.2.3