mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
* More references to SCM_CHARS removed.
This commit is contained in:
parent
3db4adfced
commit
9eb364fccb
3 changed files with 22 additions and 6 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* numbers.c (scm_adjbig): Use SCM_BDIGITS instead of SCM_CHARS.
|
||||||
|
|
||||||
|
(big2str, scm_bigprint): Use SCM_STRING_CHARS instead of
|
||||||
|
SCM_CHARS.
|
||||||
|
|
||||||
|
* vectors.c (scm_vector_set_length_x): Distinguish between
|
||||||
|
strings, scheme vectors and uniform vectors, thus getting rid of
|
||||||
|
references to SCM_CHARS. (The code still needs improvement.)
|
||||||
|
|
||||||
2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* eval.c (scm_m_letrec1, SCM_CEVAL, SCM_APPLY): Use
|
* eval.c (scm_m_letrec1, SCM_CEVAL, SCM_APPLY): Use
|
||||||
|
|
|
@ -1363,7 +1363,7 @@ scm_adjbig (SCM b, scm_sizet nlen)
|
||||||
{
|
{
|
||||||
SCM_BIGDIG *digits
|
SCM_BIGDIG *digits
|
||||||
= ((SCM_BIGDIG *)
|
= ((SCM_BIGDIG *)
|
||||||
scm_must_realloc ((char *) SCM_CHARS (b),
|
scm_must_realloc ((char *) SCM_BDIGITS (b),
|
||||||
(long) (SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG)),
|
(long) (SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG)),
|
||||||
(long) (nsiz * sizeof (SCM_BIGDIG)), s_bignum));
|
(long) (nsiz * sizeof (SCM_BIGDIG)), s_bignum));
|
||||||
|
|
||||||
|
@ -2179,7 +2179,7 @@ big2str (SCM b, unsigned int radix)
|
||||||
scm_sizet ch; /* jeh */
|
scm_sizet ch; /* jeh */
|
||||||
SCM_BIGDIG radpow = 1, radmod = 0;
|
SCM_BIGDIG radpow = 1, radmod = 0;
|
||||||
SCM ss = scm_makstr ((long) j, 0);
|
SCM ss = scm_makstr ((long) j, 0);
|
||||||
char *s = SCM_CHARS (ss), c;
|
char *s = SCM_STRING_CHARS (ss), c;
|
||||||
while ((long) radpow * radix < SCM_BIGRAD)
|
while ((long) radpow * radix < SCM_BIGRAD)
|
||||||
{
|
{
|
||||||
radpow *= radix;
|
radpow *= radix;
|
||||||
|
@ -2271,7 +2271,7 @@ scm_bigprint (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
#ifdef SCM_BIGDIG
|
#ifdef SCM_BIGDIG
|
||||||
exp = big2str (exp, (unsigned int) 10);
|
exp = big2str (exp, (unsigned int) 10);
|
||||||
scm_lfwrite (SCM_CHARS (exp), (scm_sizet) SCM_LENGTH (exp), port);
|
scm_lfwrite (SCM_STRING_CHARS (exp), (scm_sizet) SCM_LENGTH (exp), port);
|
||||||
#else
|
#else
|
||||||
scm_ipruk ("bignum", exp, port);
|
scm_ipruk ("bignum", exp, port);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -71,6 +71,7 @@ scm_vector_set_length_x (SCM vect, SCM len)
|
||||||
long l;
|
long l;
|
||||||
scm_sizet siz;
|
scm_sizet siz;
|
||||||
scm_sizet sz;
|
scm_sizet sz;
|
||||||
|
char *base;
|
||||||
|
|
||||||
l = SCM_INUM (len);
|
l = SCM_INUM (len);
|
||||||
SCM_ASRTGO (SCM_NIMP (vect), badarg1);
|
SCM_ASRTGO (SCM_NIMP (vect), badarg1);
|
||||||
|
@ -81,7 +82,9 @@ scm_vector_set_length_x (SCM vect, SCM len)
|
||||||
l = (l + SCM_LONG_BIT - 1) / SCM_LONG_BIT;
|
l = (l + SCM_LONG_BIT - 1) / SCM_LONG_BIT;
|
||||||
}
|
}
|
||||||
sz = scm_uniform_element_size (vect);
|
sz = scm_uniform_element_size (vect);
|
||||||
if (sz == 0)
|
if (sz != 0)
|
||||||
|
base = SCM_UVECTOR_BASE (vect);
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
switch (SCM_TYP7 (vect))
|
switch (SCM_TYP7 (vect))
|
||||||
{
|
{
|
||||||
|
@ -90,12 +93,14 @@ scm_vector_set_length_x (SCM vect, SCM len)
|
||||||
case scm_tc7_string:
|
case scm_tc7_string:
|
||||||
SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullstr), badarg1);
|
SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullstr), badarg1);
|
||||||
sz = sizeof (char);
|
sz = sizeof (char);
|
||||||
|
base = SCM_STRING_CHARS (vect);
|
||||||
l++;
|
l++;
|
||||||
break;
|
break;
|
||||||
case scm_tc7_vector:
|
case scm_tc7_vector:
|
||||||
case scm_tc7_wvect:
|
case scm_tc7_wvect:
|
||||||
SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullvect), badarg1);
|
SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullvect), badarg1);
|
||||||
sz = sizeof (SCM);
|
sz = sizeof (SCM);
|
||||||
|
base = (char *) SCM_VECTOR_BASE (vect);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SCM_ASSERT (SCM_INUMP (len), len, SCM_ARG2, s_vector_set_length_x);
|
SCM_ASSERT (SCM_INUMP (len), len, SCM_ARG2, s_vector_set_length_x);
|
||||||
|
@ -107,7 +112,7 @@ scm_vector_set_length_x (SCM vect, SCM len)
|
||||||
SCM_REDEFER_INTS;
|
SCM_REDEFER_INTS;
|
||||||
SCM_SETCHARS (vect,
|
SCM_SETCHARS (vect,
|
||||||
((char *)
|
((char *)
|
||||||
scm_must_realloc (SCM_CHARS (vect),
|
scm_must_realloc (base,
|
||||||
(long) SCM_LENGTH (vect) * sz,
|
(long) SCM_LENGTH (vect) * sz,
|
||||||
(long) siz,
|
(long) siz,
|
||||||
s_vector_set_length_x)));
|
s_vector_set_length_x)));
|
||||||
|
@ -118,7 +123,7 @@ scm_vector_set_length_x (SCM vect, SCM len)
|
||||||
SCM_VELTS (vect)[--l] = SCM_UNSPECIFIED;
|
SCM_VELTS (vect)[--l] = SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
else if (SCM_STRINGP (vect))
|
else if (SCM_STRINGP (vect))
|
||||||
SCM_CHARS (vect)[l - 1] = 0;
|
SCM_STRING_CHARS (vect)[l - 1] = 0;
|
||||||
SCM_SETLENGTH (vect, SCM_INUM (len), SCM_TYP7 (vect));
|
SCM_SETLENGTH (vect, SCM_INUM (len), SCM_TYP7 (vect));
|
||||||
SCM_REALLOW_INTS;
|
SCM_REALLOW_INTS;
|
||||||
return vect;
|
return vect;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue