diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:34 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:34 -0800 |
commit | 50eb784bfcf15ee3c6b0b53d747db92673395040 (patch) | |
tree | 60f039bb5aa27bc58d92ab0c7bab0d82dbfe7686 /rope.c | |
parent | ae2b295c7deaf2d7c18ad1ed9b6050970e56bae7 (diff) | |
download | scm-50eb784bfcf15ee3c6b0b53d747db92673395040.tar.gz scm-50eb784bfcf15ee3c6b0b53d747db92673395040.zip |
Import Upstream version 5e3upstream/5e3
Diffstat (limited to 'rope.c')
-rw-r--r-- | rope.c | 48 |
1 files changed, 33 insertions, 15 deletions
@@ -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: |