From 4d6ed8fe444d30c25f35739c87fb8def890635cd Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 6 Aug 2004 01:04:05 +0000 Subject: [PATCH] (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. --- libguile/ramap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libguile/ramap.c b/libguile/ramap.c index a5f78d469..53d36294b 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -473,10 +473,10 @@ scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED) break; case scm_tc7_byvect: if (SCM_CHARP (fill)) - fill = SCM_I_MAKINUM ((char) SCM_CHAR (fill)); - SCM_ASRTGO (SCM_I_INUMP (fill) - && -128 <= SCM_I_INUM (fill) && SCM_I_INUM (fill) < 128, - badarg2); + fill = SCM_I_MAKINUM ((signed char) SCM_CHAR (fill)); + SCM_ASRTGO (SCM_I_INUMP (fill), badarg2); + SCM_ASSERT_RANGE (SCM_ARG2, fill, + -128 <= SCM_I_INUM (fill) && SCM_I_INUM (fill) < 128); for (i = base; n--; i += inc) ((char *) SCM_UVECTOR_BASE (ra))[i] = SCM_I_INUM (fill); break;