summaryrefslogtreecommitdiff
path: root/libguile/unif.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2004-08-06 00:21:13 +0000
committerKevin Ryde <user42@zip.com.au>2004-08-06 00:21:13 +0000
commitbebf6a08afe9543d97e57311052bd24c656543b7 (patch)
treec0ff9cd5f94fc04bc376b0010c598ea61b850897 /libguile/unif.c
parent7f9ca7c3d71bfa1d0d908e6165cfc1d2851972d3 (diff)
downloadguile-bebf6a08afe9543d97e57311052bd24c656543b7.tar.gz
(scm_uniform_vector_ref, scm_array_set_x): For byvect, force
signed byte range checks by using scm_to_schar and scm_from_schar, don't want to depend on signedness of C char.
Diffstat (limited to 'libguile/unif.c')
-rw-r--r--libguile/unif.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libguile/unif.c b/libguile/unif.c
index 6fb9db71c..78612621c 100644
--- a/libguile/unif.c
+++ b/libguile/unif.c
@@ -1111,7 +1111,7 @@ SCM_DEFINE (scm_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0,
case scm_tc7_string:
return SCM_MAKE_CHAR (SCM_STRING_UCHARS (v)[pos]);
case scm_tc7_byvect:
- return scm_from_char (((char *) SCM_UVECTOR_BASE (v))[pos]);
+ return scm_from_schar (((char *) SCM_UVECTOR_BASE (v))[pos]);
case scm_tc7_uvect:
return scm_from_ulong (((unsigned long *) SCM_VELTS (v))[pos]);
case scm_tc7_ivect:
@@ -1273,8 +1273,8 @@ SCM_DEFINE (scm_array_set_x, "array-set!", 2, 0, 1,
break;
case scm_tc7_byvect:
if (SCM_CHARP (obj))
- obj = scm_from_char ((char) SCM_CHAR (obj));
- ((char *) SCM_UVECTOR_BASE (v))[pos] = scm_to_char (obj);
+ obj = scm_from_schar ((char) SCM_CHAR (obj));
+ ((char *) SCM_UVECTOR_BASE (v))[pos] = scm_to_schar (obj);
break;
case scm_tc7_uvect:
((unsigned long *) SCM_UVECTOR_BASE (v))[pos] = scm_to_ulong (obj);