summaryrefslogtreecommitdiffstats
path: root/record.c
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:27 -0800
commitc7d035ae1a729232579a0fe41ed5affa131d3623 (patch)
treefb387f7c2a8e01cf603d4c75fbbaa68f711df986 /record.c
parentdeda2c0fd8689349fea2a900199a76ff7ecb319e (diff)
downloadscm-c7d035ae1a729232579a0fe41ed5affa131d3623.tar.gz
scm-c7d035ae1a729232579a0fe41ed5affa131d3623.zip
Import Upstream version 5d9upstream/5d9
Diffstat (limited to 'record.c')
-rw-r--r--record.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/record.c b/record.c
index 6811575..5370daf 100644
--- a/record.c
+++ b/record.c
@@ -68,7 +68,7 @@ static SCM the_rtd_rtd;
arrays will be available when the dll is loaded */
#ifdef ARRAYS
# ifndef DLL
-# define MAKE_REC_INDS(n) make_uve((long)n, MAKINUM(1))
+# define MAKE_REC_INDS(n) make_uve((long)n, MAKINUM(32L))
# define REC_IND_REF(x, i) VELTS(x)[(i)]
# define REC_IND_SET(x, i, val) VELTS(x)[(i)] = (val)
# endif
@@ -99,7 +99,7 @@ SCM rec_pred(rtd)
SCM rtd;
{
SCM cclo = makcclo(f_rec_pred1, 2L);
- ASSERT(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_pred);
+ ASRTER(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_pred);
RCLO_RTD(cclo) = rtd;
return cclo;
}
@@ -121,7 +121,7 @@ SCM rec_constr(rtd, flds)
SCM cclo = makcclo(f_rec_constr1, 4L);
SCM indices;
sizet i, j;
- ASSERT(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_constr);
+ ASRTER(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_constr);
RCLO_RTD(cclo) = rtd;
i = ilength(RTD_FIELDS(rtd));
RCONSTR_SIZE(cclo) = MAKINUM(i);
@@ -131,14 +131,14 @@ SCM rec_constr(rtd, flds)
}
else {
i = ilength(flds);
- ASSERT(i>=0, flds, ARG2, s_rec_constr);
+ ASRTER(i>=0, flds, ARG2, s_rec_constr);
indices = MAKE_REC_INDS(i);
for(i = 0; NIMP(flds); i++, flds = CDR(flds)) {
fld = CAR(flds);
- ASSERT(NIMP(fld) && SYMBOLP(fld), fld, ARG2, s_rec_constr);
+ ASRTER(NIMP(fld) && SYMBOLP(fld), fld, ARG2, s_rec_constr);
flst = RTD_FIELDS(rtd);
for (j = 0; ; j++, flst = CDR(flst)) {
- ASSERT(NNULLP(flst), fld, ARG2, s_rec_constr);
+ ASRTER(NNULLP(flst), fld, ARG2, s_rec_constr);
if (fld==CAR(flst)) {
REC_IND_SET(indices, i, j+1);
break;
@@ -204,12 +204,12 @@ static SCM makrecclo(proc, rtd, field, what)
SCM flst;
SCM cclo = makcclo(proc, 3L);
int i;
- ASSERT(NIMP(rtd) && RTDP(rtd), rtd, ARG1, what);
- ASSERT(NIMP(field) && SYMBOLP(field), field, ARG2, what);
+ ASRTER(NIMP(rtd) && RTDP(rtd), rtd, ARG1, what);
+ ASRTER(NIMP(field) && SYMBOLP(field), field, ARG2, what);
RCLO_RTD(cclo) = rtd;
flst = RTD_FIELDS(rtd);
for (i = 1; ; i++) {
- ASSERT(NNULLP(flst), field, ARG2, what);
+ ASRTER(NNULLP(flst), field, ARG2, what);
if (CAR(flst)==field) break;
flst = CDR(flst);
}
@@ -274,8 +274,8 @@ static char s_rec_prinset[] = "record-printer-set!";
SCM rec_prinset(rtd, printer)
SCM rtd, printer;
{
- ASSERT(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_prinset);
- ASSERT(BOOL_F==printer || scm_arity_check(printer, 3L, (char *)0),
+ ASRTER(NIMP(rtd) && RTDP(rtd), rtd, ARG1, s_rec_prinset);
+ ASRTER(BOOL_F==printer || scm_arity_check(printer, 3L, (char *)0),
printer, ARG2, s_rec_prinset);
RTD_PRINTER(rtd) = printer;
return UNSPECIFIED;
@@ -385,6 +385,9 @@ static iproc subr2s[] = {
{s_makrectyp, makrectyp},
{s_rec_prinset, rec_prinset},
{0, 0}};
+
+SCM_DLL_EXPORT void init_record P((void));
+
void init_record()
{
SCM i_name = CAR(sysintern("name", UNDEFINED));