summaryrefslogtreecommitdiff
path: root/libguile/ramap.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1997-03-11 15:03:06 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1997-03-11 15:03:06 +0000
commitb1d24656ea3f43423006e65dbd108def93e5f131 (patch)
tree167bd4824b46943e64ea4020cf2585e628e77f84 /libguile/ramap.c
parent9fbaf27ccbf33b1d2f79f0eb3abf54347348905a (diff)
downloadguile-b1d24656ea3f43423006e65dbd108def93e5f131.tar.gz
* unif.c (scm_array_set_x): Cast ICHR (obj) to char if storing in
a scm_tc7_byvect. * ramap.c (scm_ra_matchp, scm_ra_matchp, scm_array_fill_int, racp, scm_array_index_map_x, raeql_1, scm_array_equal_p): Completed support for byte vectors.
Diffstat (limited to 'libguile/ramap.c')
-rw-r--r--libguile/ramap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libguile/ramap.c b/libguile/ramap.c
index 370dfd97a..ec903ece4 100644
--- a/libguile/ramap.c
+++ b/libguile/ramap.c
@@ -160,6 +160,7 @@ scm_ra_matchp (ra0, ras)
return 0;
case scm_tc7_vector:
case scm_tc7_string:
+ case scm_tc7_byvect:
case scm_tc7_bvect:
case scm_tc7_uvect:
case scm_tc7_ivect:
@@ -191,6 +192,7 @@ scm_ra_matchp (ra0, ras)
return 0;
case scm_tc7_vector:
case scm_tc7_string:
+ case scm_tc7_byvect:
case scm_tc7_bvect:
case scm_tc7_uvect:
case scm_tc7_ivect:
@@ -435,6 +437,15 @@ scm_array_fill_int (ra, fill, ignore)
for (i = base; n--; i += inc)
SCM_CHARS (ra)[i] = SCM_ICHR (fill);
break;
+ case scm_tc7_byvect:
+ if (SCM_ICHRP (fill))
+ fill = SCM_MAKINUM ((char) SCM_ICHR (fill));
+ SCM_ASRTGO (SCM_INUMP (fill)
+ && -128 <= SCM_INUM (fill) && SCM_INUM (fill) < 128,
+ badarg2);
+ for (i = base; n--; i += inc)
+ SCM_CHARS (ra)[i] = SCM_INUM (fill);
+ break;
case scm_tc7_bvect:
{
long *ve = (long *) SCM_VELTS (ra);
@@ -552,6 +563,7 @@ racp (src, dst)
scm_array_set_x (dst, scm_cvref (src, i_s, SCM_UNDEFINED), SCM_MAKINUM (i_d));
break;
case scm_tc7_string:
+ case scm_tc7_byvect:
if (scm_tc7_string != SCM_TYP7 (dst))
goto gencase;
for (; n-- > 0; i_s += inc_s, i_d += inc_d)
@@ -1816,6 +1828,7 @@ scm_array_index_map_x (ra, proc)
return SCM_UNSPECIFIED;
}
case scm_tc7_string:
+ case scm_tc7_byvect:
case scm_tc7_bvect:
case scm_tc7_uvect:
case scm_tc7_ivect:
@@ -1915,6 +1928,7 @@ raeql_1 (ra0, as_equal, ra1)
}
return 1;
case scm_tc7_string:
+ case scm_tc7_byvect:
{
char *v0 = SCM_CHARS (ra0) + i0;
char *v1 = SCM_CHARS (ra1) + i1;
@@ -2067,6 +2081,7 @@ scm_array_equal_p (ra0, ra1)
goto callequal;
case scm_tc7_bvect:
case scm_tc7_string:
+ case scm_tc7_byvect:
case scm_tc7_uvect:
case scm_tc7_ivect:
case scm_tc7_fvect:
@@ -2085,6 +2100,7 @@ scm_array_equal_p (ra0, ra1)
goto callequal;
case scm_tc7_bvect:
case scm_tc7_string:
+ case scm_tc7_byvect:
case scm_tc7_uvect:
case scm_tc7_ivect:
case scm_tc7_fvect: