mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
* Fix vector initialization.
This commit is contained in:
parent
f762051048
commit
a75923bb03
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-07-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* vectors.c (scm_make_vector): Fix the initialization order of
|
||||||
|
the vector such that the type cell is initialized last.
|
||||||
|
|
||||||
2000-07-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2000-07-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* struct.[ch] (scm_struct_init): Made static. Fixed not to rely
|
* struct.[ch] (scm_struct_init): Made static. Fixed not to rely
|
||||||
|
|
|
@ -268,10 +268,10 @@ SCM_DEFINE (scm_make_vector, "make-vector", 1, 1, 0,
|
||||||
SCM_NEWCELL(v);
|
SCM_NEWCELL(v);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
SCM_SETCHARS(v, scm_must_malloc(i?(long)(i*sizeof(SCM)):1L, FUNC_NAME));
|
SCM_SETCHARS(v, scm_must_malloc(i?(long)(i*sizeof(SCM)):1L, FUNC_NAME));
|
||||||
SCM_SETLENGTH(v, i, scm_tc7_vector);
|
|
||||||
velts = SCM_VELTS(v);
|
velts = SCM_VELTS(v);
|
||||||
j = 0;
|
for (j = 0; j < i; ++j)
|
||||||
while(--i >= j) (velts)[i] = fill;
|
velts[j] = fill;
|
||||||
|
SCM_SETLENGTH(v, i, scm_tc7_vector);
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue