diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
commit | 302e3218b7d487539ec305bf23881a6ee7d5be99 (patch) | |
tree | bf1adafe552a17b3b78522048bb7c24787696dd3 /unif.c | |
parent | c7d035ae1a729232579a0fe41ed5affa131d3623 (diff) | |
download | scm-302e3218b7d487539ec305bf23881a6ee7d5be99.tar.gz scm-302e3218b7d487539ec305bf23881a6ee7d5be99.zip |
Import Upstream version 5e1upstream/5e1
Diffstat (limited to 'unif.c')
-rw-r--r-- | unif.c | 57 |
1 files changed, 34 insertions, 23 deletions
@@ -57,7 +57,9 @@ complex double cvect #ifndef STDC_HEADERS int ungetc P((int c, FILE *stream)); +# ifndef sun sizet fwrite (); +# endif #endif long tc16_array = 0; @@ -146,12 +148,17 @@ SCM makflo (x) long scm_prot2type(prot) SCM prot; { - if (BOOL_T==prot) return tc7_bvect; if ICHRP(prot) return tc7_string; - if (MAKINUM(32L)==prot) return tc7_uvect; - if (MAKINUM(-32L)==prot) return tc7_ivect; - if (MAKINUM(-16L)==prot) return tc7_svect; - if INUMP(prot) return INUM(prot) > 0 ? tc7_uvect : tc7_ivect; + switch (prot) { + case BOOL_T: return tc7_bvect; + case MAKINUM(8L): + case MAKINUM(16L): + case MAKINUM(32L): return tc7_uvect; + case MAKINUM(-32L): return tc7_ivect; + case MAKINUM(-16L): return tc7_svect; + case MAKINUM(-8L): return tc7_svect; + } + /* if INUMP(prot) return INUM(prot) > 0 ? tc7_uvect : tc7_ivect; */ if IMP(prot) return tc7_vector; # ifdef FLOATS if INEXP(prot) { @@ -1846,26 +1853,30 @@ int raprin1(exp, port, writing) } return 1; } - else - lputs("At", port); break; - case tc7_vector: - lputc('A', port); break; - case tc7_string: - lputs("A\\", port); break; - case tc7_uvect: - lputs("Au32", port); break; - case tc7_ivect: - lputs("As32", port); break; - case tc7_svect: - lputs("As16", port); break; + default: + if (exp==v) lputc('1', port); + switch TYP7(v) { + case tc7_bvect: + lputs("A:bool", port); break; + case tc7_vector: + lputc('A', port); break; + case tc7_string: + lputs("A:char", port); break; + case tc7_uvect: + lputs("A:fixN32b", port); break; + case tc7_ivect: + lputs("A:fixZ32b", port); break; + case tc7_svect: + lputs("A:fixZ16b", port); break; # ifdef FLOATS - case tc7_fvect: - lputs("Ar32", port); break; - case tc7_dvect: - lputs("Ar64", port); break; - case tc7_cvect: - lputs("Ac64", port); break; + case tc7_fvect: + lputs("A:floR32b", port); break; + case tc7_dvect: + lputs("A:floR64b", port); break; + case tc7_cvect: + lputs("A:floC64b", port); break; # endif /*FLOATS*/ + } } if ((v != exp) && 0==ARRAY_NDIM(exp)) { lputc(' ', port); |