summaryrefslogtreecommitdiffstats
path: root/rope.c
diff options
context:
space:
mode:
Diffstat (limited to 'rope.c')
-rw-r--r--rope.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/rope.c b/rope.c
index c8a4d09..6f48982 100644
--- a/rope.c
+++ b/rope.c
@@ -168,6 +168,15 @@ short num2short(num, pos, s_caller)
if (INUMP(num) && lres==res) return res;
wta(num, pos, s_caller);
}
+signed char num2char(num, pos, s_caller)
+ SCM num;
+ char *pos, *s_caller;
+{
+ long lres = INUM((long)num);
+ char res = lres;
+ if (INUMP(num) && lres==res) return res;
+ wta(num, pos, s_caller);
+}
#ifdef FLOATS
double num2dbl(num, pos, s_caller)
SCM num;
@@ -318,21 +327,25 @@ unsigned long scm_addr(args, s_name)
break;
# ifdef FLOATS
# ifdef SINGLES
- case tc7_fvect:
- ptr = (unsigned long)&(((float *)CDR(v))[pos]);
+ case tc7_VfloC32: pos = 2 * pos;
+ case tc7_VfloR32: ptr = (unsigned long)&(((float *)CDR(v))[pos]);
break;
# endif
- case tc7_cvect: pos = 2 * pos;
- case tc7_dvect: ptr = (unsigned long)&(((double *)CDR(v))[pos]);
+ case tc7_VfloC64: pos = 2 * pos;
+ case tc7_VfloR64: ptr = (unsigned long)&(((double *)CDR(v))[pos]);
break;
# endif
- case tc7_bvect: ASRTGO(0==(pos%LONG_BIT), outrng);
+ case tc7_Vbool: ASRTGO(0==(pos%LONG_BIT), outrng);
pos = pos/LONG_BIT;
- case tc7_uvect:
- case tc7_ivect:
+ case tc7_VfixN32:
+ case tc7_VfixZ32:
case tc7_vector: ptr = (unsigned long)&(VELTS(v)[pos]);
break;
- case tc7_svect: ptr = (unsigned long)&(((short *)CDR(v))[pos]);
+ case tc7_VfixN16:
+ case tc7_VfixZ16: ptr = (unsigned long)&(((short *)CDR(v))[pos]);
+ break;
+ case tc7_VfixN8:
+ case tc7_VfixZ8: ptr = (unsigned long)&(((char *)CDR(v))[pos]);
break;
outrng: wta(MAKINUM(pos), (char *)OUTOFRANGE, s_name);
default:
@@ -358,21 +371,26 @@ unsigned long scm_base_addr(v, s_name)
break;
# ifdef FLOATS
# ifdef SINGLES
- case tc7_fvect:
+ case tc7_VfloC32: pos = 2 * pos;
+ case tc7_VfloR32:
ptr = (unsigned long)&(((float *)CDR(v))[pos]);
break;
# endif
- case tc7_cvect: pos = 2 * pos;
- case tc7_dvect: ptr = (unsigned long)&(((double *)CDR(v))[pos]);
+ case tc7_VfloC64: pos = 2 * pos;
+ case tc7_VfloR64: ptr = (unsigned long)&(((double *)CDR(v))[pos]);
break;
# endif
- case tc7_bvect: ASRTGO(0==(pos%LONG_BIT), outrng);
+ case tc7_Vbool: ASRTGO(0==(pos%LONG_BIT), outrng);
pos = pos/LONG_BIT;
- case tc7_uvect:
- case tc7_ivect:
+ case tc7_VfixN32:
+ case tc7_VfixZ32:
case tc7_vector: ptr = (unsigned long)&(VELTS(v)[pos]);
break;
- case tc7_svect: ptr = (unsigned long)&(((short *)CDR(v))[pos]);
+ case tc7_VfixN16:
+ case tc7_VfixZ16: ptr = (unsigned long)&(((short *)CDR(v))[pos]);
+ break;
+ case tc7_VfixN8:
+ case tc7_VfixZ8: ptr = (unsigned long)&(((char *)CDR(v))[pos]);
break;
outrng: wta(MAKINUM(pos), (char *)OUTOFRANGE, s_name);
default: