mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
(scm_array_fill_x): For byvect char fill, force signed char
so as not to depend on signedness of plain char. For byvect range check, throw out-of-range rather than wrong-type-arg.
This commit is contained in:
parent
29da36e4ab
commit
bc91b91e8f
1 changed files with 4 additions and 4 deletions
|
@ -497,10 +497,10 @@ scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED)
|
||||||
break;
|
break;
|
||||||
case scm_tc7_byvect:
|
case scm_tc7_byvect:
|
||||||
if (SCM_CHARP (fill))
|
if (SCM_CHARP (fill))
|
||||||
fill = SCM_MAKINUM ((char) SCM_CHAR (fill));
|
fill = SCM_MAKINUM ((signed char) SCM_CHAR (fill));
|
||||||
SCM_ASRTGO (SCM_INUMP (fill)
|
SCM_ASRTGO (SCM_INUMP (fill), badarg2);
|
||||||
&& -128 <= SCM_INUM (fill) && SCM_INUM (fill) < 128,
|
SCM_ASSERT_RANGE (SCM_ARG2, fill,
|
||||||
badarg2);
|
-128 <= SCM_INUM (fill) && SCM_INUM (fill) < 128);
|
||||||
for (i = base; n--; i += inc)
|
for (i = base; n--; i += inc)
|
||||||
((char *) SCM_UVECTOR_BASE (ra))[i] = SCM_INUM (fill);
|
((char *) SCM_UVECTOR_BASE (ra))[i] = SCM_INUM (fill);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue