summaryrefslogtreecommitdiffstats
path: root/rope.c
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:34 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:34 -0800
commit50eb784bfcf15ee3c6b0b53d747db92673395040 (patch)
tree60f039bb5aa27bc58d92ab0c7bab0d82dbfe7686 /rope.c
parentae2b295c7deaf2d7c18ad1ed9b6050970e56bae7 (diff)
downloadscm-50eb784bfcf15ee3c6b0b53d747db92673395040.tar.gz
scm-50eb784bfcf15ee3c6b0b53d747db92673395040.zip
Import Upstream version 5e3upstream/5e3
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: