mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* Added SCM_SET_VECTOR_LENGTH as one replacement for SCM_SETLENGTH.
This commit is contained in:
parent
34f0f2b8af
commit
bc0eaf7b78
5 changed files with 15 additions and 2 deletions
4
NEWS
4
NEWS
|
@ -243,6 +243,10 @@ SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
|
|||
|
||||
Use these instead of SCM_LENGTH.
|
||||
|
||||
** New macros: SCM_SET_VECTOR_LENGTH
|
||||
|
||||
Use these instead of SCM_SETLENGTH
|
||||
|
||||
** New macros: SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE,
|
||||
SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
|
||||
SCM_ARRAY_MEM
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2000-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* vectors.c (scm_make_vector), weaks.c (scm_make_weak_vector):
|
||||
Use SCM_SET_VECTOR_LENGTH instead of SCM_SETLENGTH.
|
||||
|
||||
* vectors.h (SCM_SET_VECTOR_LENGTH): Added.
|
||||
|
||||
2000-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* dynl.c (scm_make_argv_from_stringlist), filesys.c (scm_dirname,
|
||||
|
|
|
@ -293,7 +293,7 @@ SCM_DEFINE (scm_make_vector, "make-vector", 1, 1, 0,
|
|||
velts[j] = SCM_UNPACK (fill);
|
||||
|
||||
SCM_SETCHARS (v, velts);
|
||||
SCM_SETLENGTH (v, i, scm_tc7_vector);
|
||||
SCM_SET_VECTOR_LENGTH (v, i, scm_tc7_vector);
|
||||
}
|
||||
SCM_ALLOW_INTS;
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector))
|
||||
#define SCM_VECTOR_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
#define SCM_SET_VECTOR_LENGTH(v, l, t) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) + (t)))
|
||||
|
||||
#define SCM_VELTS(x) ((SCM *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_VELTS_AS_STACKITEMS(x) ((SCM_STACKITEM *) SCM_CELL_WORD_1 (x))
|
||||
|
|
|
@ -63,10 +63,11 @@ SCM_DEFINE (scm_make_weak_vector, "make-weak-vector", 1, 1, 0,
|
|||
"@var{fill}. The default value for @var{fill} is the empty list.")
|
||||
#define FUNC_NAME s_scm_make_weak_vector
|
||||
{
|
||||
/* Dirk:FIXME:: We should probably rather use a double cell for weak vectors. */
|
||||
SCM v;
|
||||
v = scm_make_vector (scm_sum (k, SCM_MAKINUM (2)), fill);
|
||||
SCM_DEFER_INTS;
|
||||
SCM_SETLENGTH(v, SCM_INUM (k), scm_tc7_wvect);
|
||||
SCM_SET_VECTOR_LENGTH (v, SCM_INUM (k), scm_tc7_wvect);
|
||||
SCM_SETVELTS(v, SCM_VELTS(v) + 2);
|
||||
SCM_VELTS(v)[-2] = SCM_EOL;
|
||||
SCM_UNPACK (SCM_VELTS (v)[-1]) = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue