From bc91b91e8f33f19141d10028fef6e9107566b213 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 6 Aug 2004 01:02: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 e2389451f..5c4e08563 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -497,10 +497,10 @@ scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED) break; case scm_tc7_byvect: if (SCM_CHARP (fill)) - fill = SCM_MAKINUM ((char) SCM_CHAR (fill)); - SCM_ASRTGO (SCM_INUMP (fill) - && -128 <= SCM_INUM (fill) && SCM_INUM (fill) < 128, - badarg2); + fill = SCM_MAKINUM ((signed char) SCM_CHAR (fill)); + SCM_ASRTGO (SCM_INUMP (fill), badarg2); + SCM_ASSERT_RANGE (SCM_ARG2, fill, + -128 <= SCM_INUM (fill) && SCM_INUM (fill) < 128); for (i = base; n--; i += inc) ((char *) SCM_UVECTOR_BASE (ra))[i] = SCM_INUM (fill); break;